# Latest release (2.19.0) breaks task

**URL:** <https://forum.ansible.com/t/latest-release-2-19-0-breaks-task/43986>\
**Category:** Get Help\
**Tags:** templating\
**Created:** [July 22, 2025, 2:34pm UTC](https://forum.ansible.com/t/latest-release-2-19-0-breaks-task/43986 "2025-07-22T14:34:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ansible2](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@Ansible2](https://forum.ansible.com/u/Ansible2)\
**Post date:** [July 22, 2025, 2:34pm UTC](https://forum.ansible.com/t/latest-release-2-19-0-breaks-task/43986/1 "2025-07-22T14:34:17Z")

</div>

I have a Playbook who install a new Software version if a new version is available. With the version ansible [core 2.14.18] (Debian Bookworm) it works, but I I use the same Playbook with ansible [core 2.19.0b6] (Debian Trixie) I get an error when I compare two registers

```auto
# get latest software version installed
- name: get latest software version installed
  shell:
    cmd: "Command to get latest version installed"
  register: software_version_installed

- debug:
    msg: latest software version installed is v{{ software_version_installed.stdout }}

# get latest software version to install
- name: get latest software version to install
  shell:
    cmd: "Command to get latest version on Github"
  register: software_version_to_install

- debug:
    msg: latest software version to install is v{{ software_version_to_install.stdout }}

# exit if latest software version is installed
- name: exit if latest software version v{{ software_version_to_install.stdout }} is installed
  fail:
    msg:
      "latest software version v{{ software_version_installed.stdout }} is installed"
  when: software_version_installed.stdout | length > 0 and software_version_to_install.stdout is version(software_version_installed.stdout, '==')

```

The error I get is

```auto
TASK [software : get latest software version installed] **********************************************************************************************
changed: [server1]

TASK [software : debug] *************************************************************************************************************************
ok: [server1] => {
    "msg": "latest software version installed is v1.0"
}

TASK [software : get latest software version to install] *********************************************************************************************
changed: [server1]

TASK [software : debug] *************************************************************************************************************************
ok: [server1] => {
    "msg": "latest software version to install is v1.0"
}

TASK [software : exit if latest software version v1.0 is installed] ******************************************************************************
[ERROR]: Task failed: Action failed: latest software version v1.0 is installed
Origin: /home/wim/playbooks/roles/software/tasks/main.yml:23:3

21
22 # exit if latest software version is installed
23 - name: exit if latest software version v{{ software_version_to_install.stdout }} is installed
     ^ column 3

fatal: [server1]: FAILED! => {"changed": false, "msg": "latest software version v1.0 is installed"}

```

- Set at least one tag (the experts follow the tags, so the right people will find you if you tag)

---

<div class="post-metadata">

**Author:** ![samccann](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/samccann/32/18_2.png) [@samccann](https://forum.ansible.com/u/samccann)\
**Post date:** [July 22, 2025, 3:11pm UTC](https://forum.ansible.com/t/latest-release-2-19-0-breaks-task/43986/2 "2025-07-22T15:11:11Z")

</div>

See [A quick guide to templating changes](https://forum.ansible.com/t/a-quick-guide-to-templating-changes/43886) for general help on core 2.19 and understanding the templating changes in that release.

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [July 22, 2025, 3:50pm UTC](https://forum.ansible.com/t/latest-release-2-19-0-breaks-task/43986/3 "2025-07-22T15:50:29Z")

</div>

You’re asking the playbook to fail if the versions are equal, and that’s what it does. (“fail” produces an error if it succeeds: [ansible.builtin.fail module – Fail with custom message — Ansible Core Documentation](https://docs.ansible.com/ansible-core/2.19/collections/ansible/builtin/fail_module.html))

What exactly are you expecting? A less “error”-like behavior if `ansible.builtin.fail` is invoked?

---

<div class="post-metadata">

**Author:** ![Ansible2](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@Ansible2](https://forum.ansible.com/u/Ansible2)\
**Post date:** [July 22, 2025, 6:13pm UTC](https://forum.ansible.com/t/latest-release-2-19-0-breaks-task/43986/4 "2025-07-22T18:13:57Z")

</div>

Thanks for your quick reply

With ansible [core 2.14.18] I get this message and then it quit the playbook like I expected.

```auto
TASK [zed : exit if latest zed version v1.0 is installed] ******************************************************************************
fatal: [wegc203063]: FAILED! => {"changed": false, "msg": "latest zed version v1.0 is installed"}

```

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [July 22, 2025, 8:03pm UTC](https://forum.ansible.com/t/latest-release-2-19-0-breaks-task/43986/5 "2025-07-22T20:03:11Z")

</div>

It’s the same error, it just contains extra context information about where the error came from.

---

<div class="post-metadata">

**Author:** ![Ansible2](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@Ansible2](https://forum.ansible.com/u/Ansible2)\
**Post date:** [July 23, 2025, 5:39am UTC](https://forum.ansible.com/t/latest-release-2-19-0-breaks-task/43986/6 "2025-07-23T05:39:34Z")

</div>

Now it looks like a fatal error, an it shouldn’t be an error. Just quit the playbook with a message if the latest version is installed.  
Is there another way to do it more clear?  
Many thanks.

---

<div class="post-metadata">

**Author:** ![ildjarn](https://avatars.discourse-cdn.com/v4/letter/i/8491ac/32.png) [@ildjarn](https://forum.ansible.com/u/ildjarn)\
**Post date:** [July 23, 2025, 6:02am UTC](https://forum.ansible.com/t/latest-release-2-19-0-breaks-task/43986/7 "2025-07-23T06:02:49Z")

</div>

```yaml
- name: Stop playbook
  when: old.version == new.version
  block:
    - name: Show that the versions are the same
      ansible.builtin.debug:
        msg: The versions are the same

    - name: Stop this host
      ansible.builtin.meta: end_host

```

---

<div class="post-metadata">

**Author:** ![Ansible2](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@Ansible2](https://forum.ansible.com/u/Ansible2)\
**Post date:** [July 23, 2025, 7:55am UTC](https://forum.ansible.com/t/latest-release-2-19-0-breaks-task/43986/8 "2025-07-23T07:55:13Z")

</div>

Many thanks!!  
That’s a much nicer way to end the playbook 😀

---

<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:** [August 22, 2025, 7:56am UTC](https://forum.ansible.com/t/latest-release-2-19-0-breaks-task/43986/9 "2025-08-22T07:56:00Z")

</div>

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