# Error RC with ansible.builtin.shell: yum check-update

**URL:** <https://forum.ansible.com/t/error-rc-with-ansible-builtin-shell-yum-check-update/45353>\
**Category:** Get Help\
**Created:** [February 17, 2026, 2:10pm UTC](https://forum.ansible.com/t/error-rc-with-ansible-builtin-shell-yum-check-update/45353 "2026-02-17T14:10:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![merrittr](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@merrittr](https://forum.ansible.com/u/merrittr)\
**Post date:** [February 17, 2026, 2:10pm UTC](https://forum.ansible.com/t/error-rc-with-ansible-builtin-shell-yum-check-update/45353/1 "2026-02-17T14:10:24Z")

</div>

I have some ansible that failes on one node just running ansible.builtin.shell yum commands the rc code 100  
which doesnt seem to be an error at all?

- **yum check-update** returns exit value of 100 if there are packages available for an update. Also returns a list of the packages to be updated in list format.

any idea what I am doing wrong?

```auto
    - name: yum list
      ignore_errors: yes
      ansible.builtin.shell: yum check-update --exclude=389-ds* --disablerepo=* --enablerepo=rhui* > /root/{{ inventory_hostname }}.txt

```

```auto
TASK [yum list] *****************************************************************************************************************************************************************************
fatal: [SISLIC]: FAILED! => {"changed": true, "cmd": "yum check-update --exclude=389-ds* --disablerepo=* --enablerepo=rhui* > /root/SISLIC.txt", "delta": "0:00:09.812078", "end": "2026-02-17 08:55:36.440690", "msg": "non-zero return code", "rc": 100, "start": "2026-02-17 08:55:26.628612", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

```

---

<div class="post-metadata">

**Author:** ![kks](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kks/32/10352_2.png) [@kks](https://forum.ansible.com/u/kks)\
**Post date:** [February 17, 2026, 2:16pm UTC](https://forum.ansible.com/t/error-rc-with-ansible-builtin-shell-yum-check-update/45353/2 "2026-02-17T14:16:41Z")

</div>

ansible assums that any return code that is not 0 (zero) indicates failure of the command. As you mentioned return code is 100, so ansible fail.

See in the log you provided ““msg”: “non-zero return code”, “rc”: 100,“

```yaml
- name: yum list
  ansible.builtin.shell: yum check-update --exclude=389-ds* --disablerepo=* --enablerepo=rhui* > /root/{{ inventory_hostname }}.txt
  failed_when: false

```

adding directive ‘failed\_when’ should help.  
There is another more precise approach:

```yaml
- name: yum list
  ansible.builtin.shell: yum check-update --exclude=389-ds* --disablerepo=* --enablerepo=rhui* > /root/{{ inventory_hostname }}.txt
  register: yum_check_update
  failed_when: yum_check_update.rc not in [0,100]

```

This will fail only if return code (see ‘.rc’) is not 0 or 100.

Generally you should not use ignore\_errors, see [https://medium.com/@sbarnea/why-ansible-ignore-errors-is-evil-500fb6e81229](https://medium.com/@sbarnea/why-ansible-ignore-errors-is-evil-500fb6e81229)

---

<div class="post-metadata">

**Author:** ![merrittr](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@merrittr](https://forum.ansible.com/u/merrittr)\
**Post date:** [February 17, 2026, 3:54pm UTC](https://forum.ansible.com/t/error-rc-with-ansible-builtin-shell-yum-check-update/45353/3 "2026-02-17T15:54:01Z")

</div>

Yup that did the trick , thanks!

---

<div class="post-metadata">

**Author:** ![U880D](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/u880d/32/10032_2.png) [@U880D](https://forum.ansible.com/u/U880D)\
**Post date:** [February 18, 2026, 7:10am UTC](https://forum.ansible.com/t/error-rc-with-ansible-builtin-shell-yum-check-update/45353/4 "2026-02-18T07:10:15Z")

</div>

> [@merrittr](#):
>
> … `yum` commands the exit code 100 which doesn’t seem to be an error at all?

Right, that’s the case. According `man yum`

> `check-update`  
> Non-interactively checks if updates of the specified  
> packages in the repository are available. DNF exit code  
> will be 100 when there are updates available and a list of  
> the updates will be printed.

The 100 means just, there are updates available and a list of them is provided. According the return code the case needs then to be addressed appropriate, in example as shown in the given answer.

---

<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:** [March 20, 2026, 7:10am UTC](https://forum.ansible.com/t/error-rc-with-ansible-builtin-shell-yum-check-update/45353/5 "2026-03-20T07:10:26Z")

</div>

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