Combine inventory listings

Hi,

I am working with multiple Openstack and AWS clouds and need to run application installation on instances across across them. I currently run my playbooks against each cloud separately using the dynamic openstack.py and ec2.py as I need the dynamic functionality thes provide. Apart from rerunning the same playbook multiple times I also sometimes need information about hosts that resides in a different cloud (i.e. IP Address for security groups). I was wondering if there is a way to combine different inventory outputs into a single usable inventory list that can be used by a playbook.

Hi,

With last version of Ansible (2.4), you can specify multiple inventory files (-i inventory1 -i inventory2). Maybe this is what you’re looking for?

Regards

Thats sounds like what I need although (apart from an upgrade from 2.2) I’m wondering how would that handle the different authentication credentials needed for each cloud dynamic scripts?

In this case, maybe you need to wrap your dynamic inventory script with a shell script that set env variables correctly.

Pre 2.4 you can just put the scripts and configuration in the same
directory and use the directory as the inventory.

There should be no need to wrap the dynamic inventories as they dont
have overlapping settings, unless they are the same script.
As for remote auth, I recommend setting up connection variables as
group vars and assigning each source of inventory to one of the groups
so as not to have to pass it from the CLI.