Ansible Handler notify vs register

前端 未结 3 1007
梦谈多话
梦谈多话 2021-01-30 20:29

So after reading Ansible docs, I found out that Handlers are only fired when tasks report changes, so for example:

some tasks ...
notify: nginx_rest         


        
3条回答
  •  情话喂你
    2021-01-30 20:39

    On the Ansible Variables page, you can see how register works.

    Another major use of variables is running a command and using the result of that command to save the result into a variable.

    Registered variables are just like facts:

    Effectively registered variables are just like facts.

    This is very different from notify, which triggers handlers. It does not save or store variables or facts.

提交回复
热议问题