ansible 2.1.0 failures

21 views
Skip to first unread message

Dmitry Makovey

unread,
Jul 19, 2016, 6:27:08 PM7/19/16
to Ansible Project
I keep on stepping on the same issue that I do not believe I've ever had in pre-2.1.0 versions (mind you I've had long gap since list I've built playbooks... so my references could go as far back as 1.9)

Here's the issue:


- hosts: some_hosts
  gather_facts
: False
  tasks
:
 
- block:
     
- name: Run puppet agent
        puppet
:
       
register: puppet_run
        failed_when
: puppet_run.stdout.find('Finished catalog run in') == -1 and puppet_run.stdout.find('configuration client already in progress') == -1


   
rescue:
     
- name: add host to the list of failed puppets
        add_host
: name={{ inventory_hostname }} group=failed_puppets


failed_when works as expected so far, however at the end of the run I have only *one* failed host in "failed_puppets" instead of about 10 that ansible did recognize but for some reason refuses to do "add_host" there. Delegating add_host is not helping either.


Reply all
Reply to author
Forward
0 new messages