Hello everyone,
I have a small problem and I am not sure whether this is a bug or "works as defined". We have a few Junos devices we are configuring and they require ansible_connection=local, but since 2.0 if one of the hosts/inventory items fails, he does not simply skip this one host, but all. Here is a simple sample to simulate this behaviour without the need for a Junos host:
Inventory (where 10.118.194.22 is down):
[junos]
10.118.194.11 ansible_connection=local
10.118.194.12 ansible_connection=local
10.118.194.21 ansible_connection=local
10.118.194.22 ansible_connection=local
Playbook (as port use something that is reachable ;) ):
---
- name: play1
hosts: junos
gather_facts: no
tasks:
- name: task1
wait_for: host={{ inventory_hostname }} port=22 timeout=5
- name: task2
wait_for: host={{ inventory_hostname }} port=22 timeout=5
- name: play2
hosts: junos
gather_facts: no
tasks:
- name: task3
wait_for: host={{ inventory_hostname }} port=22 timeout=5
What I would expect:
- starting play1
- running task1, failing on 10.118.194.22
- running task2 only for the non-failed hosts
- starting play2
- running task3 only for the non-failed hosts
What actually happens, is that he is not even starting play2. I suspect that the connection=local makes ansible behave like all four hosts are actually only one hosts. And since this one host failed skip it in all other plays. If you remove ansible_connection=local from each host (assuming they are ssh-able) it works as expected.
Is this a bug? Should I put this in Ansible Development?
Best regards,
Jesse