Actions
Bug #32796
closedEven though a successfully playbook run, the job result is still marked as failed
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:
Description
Cloned from bugzilla 1971395
When using a playbook with blocks to handle errors, it's run successfully but the job is marked as failed.
Playbook:
~~~
- hosts: all
gather_facts: false
tasks:
- name: Handle the error
block:
- name: Print a message
ansible.builtin.debug:
msg: 'I execute normally'
- name: Force a failure
ansible.builtin.command: /bin/false
ignore_errors: yes
- name: Never print this
ansible.builtin.debug:
msg: 'I never execute, due to the above task failing, :-('
rescue:
- name: Print when errors
ansible.builtin.debug:
msg: 'I caught an error, can do stuff here to fix it, :-)'
~~~
Updated by Adam Ruzicka about 4 years ago
- Project changed from foreman-tasks to Ansible
- Category deleted (
Proxy plugin)
This ansible specific, we cannot really do anything about it in tasks.
Updated by The Foreman Bot about 4 years ago
- Status changed from New to Ready For Testing
- Assignee set to Hao Yu
- Pull request https://github.com/theforeman/smart_proxy_ansible/pull/38 added
Updated by The Foreman Bot almost 4 years ago
- Fixed in Releases smart_proxy_ansible-3.3.0 added
Updated by Hao Yu almost 4 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset smart_proxy_ansible|79ea7d7d72f05a74ecd400d8dfd39b8505bcc009.
Updated by The Foreman Bot almost 4 years ago
- Pull request https://github.com/theforeman/foreman_ansible/pull/425 added
Updated by Adam Ruzicka almost 4 years ago
- Fixed in Releases foreman_ansible_core 4.1.1 added
Actions