1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Ansible Tips: handlerはis changedで良く無い?

Posted at

handlerで行うことは、is changedで対応可能と思われる。

- name: 設定処理1
  task01:
  register: task01_result

- name: 設定処理2
  task02:
  register: task02_result

...

- name: 反映処理
  task0Z:
  when: |-
    task01_result is changed 
    or task02_result is changed

handler構成に対するis changed対応構成のメリット

  • handler, notifyといった概念が不要となり、学習コストが削減、かつplaybookがシンプルに

is changed対応構成に対するhandler構成のメリット

  • is changedの場合にはwhenにおけるor文が対応するtaskだけ必要となるが、handler構成ではその様なことはない
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?