# Task marked as FAILED, even tough changed\_when: true

**URL:** <https://forum.ansible.com/t/task-marked-as-failed-even-tough-changed-when-true/11162>\
**Category:** Get Help\
**Created:** [November 26, 2024, 2:32pm UTC](https://forum.ansible.com/t/task-marked-as-failed-even-tough-changed-when-true/11162 "2024-11-26T14:32:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fs3000](https://avatars.discourse-cdn.com/v4/letter/f/7bcc69/32.png) [@fs3000](https://forum.ansible.com/u/fs3000)\
**Post date:** [November 26, 2024, 2:32pm UTC](https://forum.ansible.com/t/task-marked-as-failed-even-tough-changed-when-true/11162/1 "2024-11-26T14:32:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![flowerysong](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/flowerysong/32/2305_2.png) [@flowerysong](https://forum.ansible.com/u/flowerysong)\
**Post date:** [November 26, 2024, 3:41pm UTC](https://forum.ansible.com/t/task-marked-as-failed-even-tough-changed-when-true/11162/2 "2024-11-26T15:41:33Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [December 26, 2024, 3:41pm UTC](https://forum.ansible.com/t/task-marked-as-failed-even-tough-changed-when-true/11162/3 "2024-12-26T15:41:41Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
