Say I have a playbook like this:
- name: install apache config
copy: src=httpd.conf dest=/etc/httpd.conf
notify: restart apache - name: do something that fails
command: false
I ran it without --force-handlers. The first command ran successfully, and reported a change. The second command failed, and as a result, the “restart apache” handler doesn’t get called.
If I run it again, even with --force-handlers, the first command won’t report a change, so the handler still won’t get called. This leaves the node in an incomplete state.
Is there a way to handle this kind of situation easily? Obviously in this case I can manually restart Apache, but in more complex cases, I’d like to be able to force the handler to run.
Or is the solution to always run with --force-handlers, so it never gets in this state to begin with?
Thanks,
Jacob