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:
hosts: burnside-lab-srp.gw.mcgill.ca