When using yum check-update in Ansible Playbook, it may failed sometimes because of the following reasons:
- 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.
- yum check-update returns 0 if no packages are available for update.
- yum check-update returns 1 if an error occurred.
The easiest way is to use ignore_error: yes
in your that task, but this will also cause other return codes to be ignored and your playbook will continue execute.
The better way is to add the following line: