On 29. juni 2017 12:08, MKPhil wrote:
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?
I can confirm this behavior. To me it looks like a bug.

--
Kai Stian Olstad

--
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/cb7b61f9-6a85-3b9f-1d90-f9969306b41e%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to