9

Is there a way to directly run handler by ansible-playbook?

For example, i have handler restart service in my role and sometimes i want just trigger it directly without deploying whole app.

rootatdarkstar
  • 1,486
  • 2
  • 15
  • 26

1 Answers1

12

There are a number of options answered in a similar post on ServerFault. In summary:

Options for triggering a particular handler:

  • Use a no-op command to trigger it
  • Use a debug with changed_when: true to trigger it

Options for triggering all handlers:

  • Run with --force-handlers
  • Use a meta: flush_handlers task

Options for re-architecting:

  • Use a task instead
Community
  • 1
  • 1
Xiong Chiamiov
  • 13,076
  • 9
  • 63
  • 101