calling a role and passing it a different host

7 views
Skip to first unread message

Spiro Mitsialis

unread,
Sep 19, 2019, 1:20:45 PM9/19/19
to Ansible Project
I have playbook that is running for a network switch.  From within this playbook, I want to call a role which will run a IOS Ansible module but the host should be a different device (host).  The different device is its upstream neighbor which the first playbook gets doing a URI call to a database.  I dont have the information before the URI call.
Both devices are listed in my hosts inventory file.
I have tried listing the new host in the role/vars/main.yml file but it still sees the first network switch.
    hosts: xxxxxxx

I have also tried specifying hosts when calling the role:
  - name: call manage trunk vlans
    include_role: 
      name: manage_trunk_vlans
    vars:
Reply all
Reply to author
Forward
0 new messages