Hi All,--
I am trying to understand how the inventory structure works with group_vars. I currently have:
├── inventory/
│ ├── cisco/
│ │ ├── 2621XM/
│ │ │ └── 12.4/
│ │ │ └── cg/
│ │ │ └── 1
│ │ └── WS-C3550/
│ │ └── 12.2/
│ │ └── cg/
│ │ └── 1
│ └── group_vars/
│ ├── 2621XM
│ ├── all
│ ├── cisco
│ └── WS-C3550
Where the default inventory path in Ansible.cfg is set to /etc/ansible/inventory.
While the above dir structure works, it's not what I am after. I want to be able to set group (cg) specific vars to hosts specified in the INI (1) but still run the playbook from my default inventory path - because I want to run one playbook on all of the hosts but have different login creds for each cg file (eg: 1).
Is this possible, or do I have to do something like this:
├── inventory/
│ ├── cisco/
│ │ ├── 2621XM/
│ │ │ └── 12.4/
│ │ │ └── cg/
│ │ │ └── 1
│ │ │ └── group_vars
│ │ │ └── all
Then run ansible-playbook play.yml -i /etc/ansible/inventory/cisco/2621XM/12.4/cg
Any help would be much appreciated.
Regards,
James
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+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/35224535-2a88-435e-a977-33c3d0d973b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.