run handlers at

16 views
Skip to first unread message

ahai...@gmail.com

unread,
Nov 19, 2014, 4:45:49 AM11/19/14
to ansible...@googlegroups.com
Hello,


"...handlers are only fired when certain tasks report changes, and are run at the end of each play"

Is it possible to run handlers directly instead of the end of each play? If not, is it possible to run a task after a handler has been run?

Thank you for your help?

Frédéric Badel

unread,
Nov 19, 2014, 10:00:29 AM11/19/14
to ansible...@googlegroups.com
Hi,

You can use 

- meta: flush_handlers

within your playbook, all pending handlers will be executed.
You can then go on with you playbook

The doc also state that: 
"Roles are described later on. It’s worthwhile to point out that handlers are automatically processed between ‘pre_tasks’, ‘roles’, ‘tasks’, and ‘post_tasks’ "
So, if you need to run some tasks after you handlers have been fired, you can use a “post_tasks” section at the end of you playbook.

Cheers,

Fred
 

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/cfbd5901-3325-4484-8a36-a67191999f10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages