I'm running Ansible 2.3.1.0 and getting some off behaviour with 
clear_host_errors - is this a bug???

Here's a sample Playbook:

---
- name: Check Servers
  gather_facts: false
  hosts: windows
  tasks:
    - name: Check server with win_ping
      win_ping:
      register: result
      ignore_errors: yes
    - meta: clear_host_errors
    - debug:
        msg: "{{ inventory_hostname | quote }} {{ result | default() }}"
...


If I run that as:  *ansible-playbook -i hosts  ping_check.yml * I get the 
desired result - that is a *debug* print of the result, regardless of 
whether the *win_ping* task failed or not.

If I run:  *ansible-playbook -i hosts  ping_check.yml -l 
failingserver.fqdn.local*  (i.e. specifically target a server I know it 
will fail on) the playbook exits after the *win_ping *task and never 
reaches the *debug* task (which it does in the first command for this 
server)

I get the same behaviour if I use an inventory file containing *just* 
*failingserver.fqdn.local* or multiple "failingservers".  It seems to be 
the case that the inventory must contain *at least one* good server before 
clear_host_errors actually works.  Can anyone repeat this issue?  Is it a 
bug that needs reporting on Github?

Phil






-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/115ff896-e19b-4fca-8281-f6dfee1918f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to