From the course: Ansible: From Basics to Guru by Pearson

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Understanding task execution and errors

Understanding task execution and errors - Ansible Tutorial

From the course: Ansible: From Basics to Guru by Pearson

Understanding task execution and errors

So when you are running a playbook, tasks are executed and errors may occur. It's important that you understand what is going to happen if an error occurs. If playback syntax has an error, the playbook will not run at all, and you will be notified. So you can check and correct the error before you are going to run the playbook. If the playbook syntax is correct, specific tasks may still result in an error. And if the error is not syntax-oriented, but task-oriented, then the task cannot run successfully and further execution of the entire play on the failing host is stopped. That's a serious condition and that's a condition that you might want to avoid. Now if you don't want your playbook to stop if an error occurs, you can use ignoreErrorsTrue in the play header or in the task. Let me show you. So let me create with error, with YML. I want to show you two different errors, so I'm going to write something that is terrible. And I like writing it so that you can get some practice in…

Contents