2

What do skipped, rescued, and ignored results mean in an Ansible playbook execution? What would be a possible scenario where these results would be different from 0?

PLAY RECAP *******************************************************************
localhost: ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
2
  • could you please provide a text version of the screenshot, making it easier to read and more accessible? thanks! Aug 18 at 9:11
  • I did it. Thank you for having pointed to that. Aug 18 at 9:20
3

For example, the play below

- hosts: localhost
  tasks:

    - name: Task will be SKIPPED
      debug:
        msg: You will never see this message.
      when: false

    - name: Failed command will be IGNORED
      command: /usr/bin/false
      ignore_errors: true

    - name: Failed command will be RESCUED
      block:
        - command: /usr/bin/false
      rescue:
        - debug:
            msg: "{{ ansible_failed_result }}"

gives

PLAY RECAP *******************************************************************
localhost: ok=2 changed=1 unreachable=0 failed=0 skipped=1 rescued=1 ignored=1

For details see

Briefly, an error is ignored when you set ignore_errors: true. This can be set on multiple levels. See Playbook Keywords. If you use block/rescue you can actively handle the consequences of the error.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.