Harshil Mathur
Harshil Mathur

Reputation: 176

How to continue with the next file if one fails in Ansible playbook?

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.

Upvotes: 1

Views: 7244

Answers (1)

DomaNitro
DomaNitro

Reputation: 3244

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

Upvotes: 4

Related Questions