FreeKB - meta clear_host_errors module (continue fail fatal)
Ansible - meta clear_host_errors module (continue fail fatal)

The clear_host_errors module will clear fatal and fail errors. For example, let's say you have a playbook that uses the shell module to ping managed nodes(e.g. target systems).

---
- hosts: all
  tasks:
    - shell: "ping -c1 {{ inventory_hostname }}"
      register: out

    - debug:
        msg: "{{ out.rc }}"

 

The following should be produced. Notice that the shell TASK returned that server2.example.com was unreachable, and then server2.example.com was not processed in the subsequent debug task.

PLAY [all]

TASK [Gathering Facts]
ok: [server1.example.com]
ok: [server2.example.com]

TASK [shell]
changed: [server1.example.com]
fatal: [server2.example.com]" UNREACHABLE! => {"msg": "Failed to connect to the host via ssh: ssh: connect to host server1.example.com port 22: Connection refused", "unreachable": true}

TASK [debug]
ok: [server1.example.com] => {
    "msg": "0"
}

PLAY RECAP
server1.example.com : ok=2  changed=1  unreacable=0  failed=0
server1.example.com : ok=2  changed=1  unreacable=0  failed=0

 

The clear_host_errors module will change this behavior, so that server2.example.com is processed in the subsequent debug task.

---
- hosts: all
  tasks:
    - shell: "ping -c1 {{ inventory_hostname }}"
      register: out

    - meta: clear_host_errors

    - debug:
        msg: "{{ out.rc }}"

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter bb8c6 in the box below so that we can be sure you are a human.




Comments


September 29th, 2019 by Tony
Good afternoon. I am planning to buy one of these thinclients: https ://thinclientbenefits.com/products/wyse-5070 the "Extended" option. But need to know if I can install a Linux distro on it (for example TinyCorePlus by following your walkthru, or the procedure does not apply anymore to newer thinclient generations? If that is the case, what can you suggest I should do? I plan to use the machine as an HTPC, so I NEED to get rid of the thinclient's OS and install a "household" :P OS, so any suggestion will be welcome. Thank you for your attention.

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |