Task marked as FAILED, even tough changed_when: true

Hello everyone,

Why ansible marks the task as FAILED even tough, that task has changed_when: true or when it matches a specific condition?

That makes the playbook stop, instead of marking as CHANGED (yellow), and let the playbook continue to run.

Because the task failed.

changed_when only matters for successful tasks. If you want to modify the definition of success for a task, you need to do that using failed_when.

3 Likes