Skip to Main Content
Mastering Ansible
book

Mastering Ansible

by Jesse Keating
November 2015
Intermediate to advanced content levelIntermediate to advanced
236 pages
4h 42m
English
Packt Publishing
Content preview from Mastering Ansible

Chapter 4. Controlling Task Conditions

Ansible fundamentally operates on the concept of task statuses: Ok, Changed, Failed, or Skipped. These statuses determine whether any further tasks should be executed on a host, and whether handlers should be notified due of any changes. Tasks can also make use of conditionals that check the status of previous tasks to control operation.

In this chapter, we'll explore ways to influence Ansible when determining the task status:

  • Controlling what defines a failure
  • Controlling what defines a change

Defining a failure

Most modules that ship with Ansible have an opinion on what constitutes an error. An error condition is highly dependent upon the module and what the module is attempting to accomplish. When a module ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Automating with Ansible

Automating with Ansible

Sander van Vugt

Publisher Resources

ISBN: 9781784395483Supplemental Content