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.