I currently have three ansible tasks:
- create vhosts
- test config
- reload nginx
I now registered the last two as handlers, but the forward notifications of ansible feel wrong for what i am doing:
- create vhosts, notify test config (okay)
- test config, notify reload (why does a config test imply a reload)
- reload nginx
I would like a structure like:
- create vhosts, notify nginx reload
- nginx reload: require config test
- config test: success
- nginx reload
Just because the semantics seem more correct. It should be neither just a sequence, nor should something like a config test notify a reload, because this is just implementing a sequence again without logic behind (like a reload requires a test first)
ignore_errors
on a task then your playbook will simply terminate when an error is encountered. So simply running your tasks in order should be enough. If one fails then execution halts before the next task is executed.