# Combine inventory listings

**URL:** <https://forum.ansible.com/t/combine-inventory-listings/25753>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [October 16, 2017, 8:01am UTC](https://forum.ansible.com/t/combine-inventory-listings/25753 "2017-10-16T08:01:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scott](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@Scott](https://forum.ansible.com/u/Scott)\
**Post date:** [October 16, 2017, 8:01am UTC](https://forum.ansible.com/t/combine-inventory-listings/25753/1 "2017-10-16T08:01:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Yannig\_Perre](https://avatars.discourse-cdn.com/v4/letter/y/5fc32e/32.png) [@Yannig\_Perre](https://forum.ansible.com/u/Yannig_Perre)\
**Post date:** [October 16, 2017, 8:07am UTC](https://forum.ansible.com/t/combine-inventory-listings/25753/2 "2017-10-16T08:07:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Scott](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@Scott](https://forum.ansible.com/u/Scott)\
**Post date:** [October 16, 2017, 8:17am UTC](https://forum.ansible.com/t/combine-inventory-listings/25753/3 "2017-10-16T08:17:16Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Yannig\_Perre](https://avatars.discourse-cdn.com/v4/letter/y/5fc32e/32.png) [@Yannig\_Perre](https://forum.ansible.com/u/Yannig_Perre)\
**Post date:** [October 16, 2017, 8:48am UTC](https://forum.ansible.com/t/combine-inventory-listings/25753/4 "2017-10-16T08:48:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [October 16, 2017, 1:27pm UTC](https://forum.ansible.com/t/combine-inventory-listings/25753/5 "2017-10-16T13:27:09Z")

</div>

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.
