Project

General

Profile

Actions

Bug #32796

closed

Even though a successfully playbook run, the job result is still marked as failed

Added by Hao Yu about 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-

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, :-)'
~~~
Actions #1

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.

Actions #2

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
Actions #3

Updated by The Foreman Bot almost 4 years ago

  • Fixed in Releases smart_proxy_ansible-3.3.0 added
Actions #4

Updated by Hao Yu almost 4 years ago

  • Status changed from Ready For Testing to Closed
Actions #5

Updated by The Foreman Bot almost 4 years ago

  • Pull request https://github.com/theforeman/foreman_ansible/pull/425 added
Actions #6

Updated by Adam Ruzicka almost 4 years ago

  • Fixed in Releases foreman_ansible_core 4.1.1 added
Actions

Also available in: Atom PDF