Hi guys!

Inventory POC_ENV.yml file:

all:
  children:
    POC_ENV:
      hosts:
        TEST-NXOS2
        TEST-NXOS3
  vars:
    ansible_ssh_private_key_file: /home/ansible/.ssh/id_rsa
    ansible_ssh_common_args: 
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
    ansible_user: ansible


Playbook new_vlan_playbook.yml file:

---
  - name: 
---------------   1. Applying Layer 2 Configuration   ---------------
    hosts: POC_ENV
    connection: local
    tasks:
    - include_vars:
        dir: /etc/ansible/roles/new_vlan/vars/
    - include_role:
        name: new_vlan
        tasks_from: add_vlan.yml

  - name: 
---------------   3. Applying Layer 3 Configuration   ---------------
    hosts: POC_ENV
    connection: local
    tasks:
    - include_vars:
        dir: /etc/ansible/roles/new_vlan/vars/
    - include_role:
        name: new_vlan
        tasks_from: create_svi.yml


# Final result = create VLAN and SVI for predefined group

When im running my code when my inventory file mentions only one of the 
machines TEST-NXOS2/TEST-NXOS3 the code is working perfectly.

But when adding a second host (doesn't matter if NXOS2 or 3 is added) the 
code fails with this error:

[image: ansible ping proof.PNG]





Working run proof on one host:

[image: ansible ping proof.PNG]


What am I missing here?
Am I supposed to tell it to run for each line in POC_ENV.yml file or is it 
already supposed to know it? because from what I understand ansible is 
supposed to run on all hosts in parallel and not itterate one by one..

Thanks in advance,
YP

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/86afaa6c-f080-46a7-b6c1-552142c773f2%40googlegroups.com.

Reply via email to