1
votes

I have a main ansible playbook site.yml which includes three books one for webservers, one for dbservers, one for others.
Each has their own selection crietia specified in their own files e.g hosts:tag_name_webapp1 and similar. The issue is, if all hosts in web servers fail, ansible stops execution then and there. I want it to continue with the tasks in dbservers and so on.

1
Have you read docs.ansible.com/…?Mxx
Yes, but that has to be applied to each task. I wanted something for included files.Harshil Mathur
Provide a tag to each role and use --tags to include the roles that you want to provision, in case you know that one will fail for certain just don't include it or use --skip-tags to skip it (i.e ansible-playbook site.yml --skip-tags "webservers")AHT

1 Answers

4
votes

If you want to continue on to the next task after one fails, you can use ignore_errors.

https://docs.ansible.com/playbooks_error_handling.html#ignoring-failed-commands