How to force handler to run before executing a task in Ansible?

依然范特西╮ 提交于 2019-11-28 06:10:31

If you want to force the handler to run in between the two tasks instead of at the end of the play, you need to put this between the two tasks:

- meta: flush_handlers

Example taken from the ansible documentation :

tasks:
   - shell: some tasks go here
   - meta: flush_handlers
   - shell: some other tasks

Note that this will cause all pending handlers to run at that point, not just that specific one.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!