# Syncing inventories between Ansible and Ansible Tower?

**URL:** <https://forum.ansible.com/t/syncing-inventories-between-ansible-and-ansible-tower/28015>\
**Category:** AWX Project\
**Created:** [July 10, 2018, 6:04pm UTC](https://forum.ansible.com/t/syncing-inventories-between-ansible-and-ansible-tower/28015 "2018-07-10T18:04:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeffrey\_Wong1](https://avatars.discourse-cdn.com/v4/letter/j/cab0a1/32.png) [@Jeffrey\_Wong1](https://forum.ansible.com/u/Jeffrey_Wong1)\
**Post date:** [July 10, 2018, 6:04pm UTC](https://forum.ansible.com/t/syncing-inventories-between-ansible-and-ansible-tower/28015/1 "2018-07-10T18:04:48Z")

</div>

Can someone please suggest a way to keep an inventory file used for Ansible playbooks called from command line (ansible-playbook -i [inventory file] …) with a similar inventory used by Ansible Tower?  
For example I have a static inventory file:

[myhosts]  
hostname1  
hostname2

hostname3

Instead of updating this file and updating a similar inventory in Tower each time a new host is added, is there a way both share the same inventory, or some way to sync one with the other?

---

<div class="post-metadata">

**Author:** ![Tu\_DT](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@Tu\_DT](https://forum.ansible.com/u/Tu_DT)\
**Post date:** [July 11, 2018, 2:08am UTC](https://forum.ansible.com/t/syncing-inventories-between-ansible-and-ansible-tower/28015/2 "2018-07-11T02:08:52Z")

</div>

I think you could use awx-manage utility for this task. More detail by follow this:

[https://docs.ansible.com/ansible-tower/latest/html/administration/tower-manage.html](https://docs.ansible.com/ansible-tower/latest/html/administration/tower-manage.html)

Regards,  
Tu DT

---

<div class="post-metadata">

**Author:** ![fabiancernota](https://avatars.discourse-cdn.com/v4/letter/f/e9bcb4/32.png) [@fabiancernota](https://forum.ansible.com/u/fabiancernota)\
**Post date:** [July 11, 2018, 6:26am UTC](https://forum.ansible.com/t/syncing-inventories-between-ansible-and-ansible-tower/28015/3 "2018-07-11T06:26:45Z")

</div>

Hey Jeffrey,

you can import your Inventory from a Git Repository. See Inventory → New → Sources.

I hope this will help you 🙂

Fabian

---

<div class="post-metadata">

**Author:** ![AlanCoding](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/alancoding/32/301_2.png) [@AlanCoding](https://forum.ansible.com/u/AlanCoding)\
**Post date:** [July 11, 2018, 12:40pm UTC](https://forum.ansible.com/t/syncing-inventories-between-ansible-and-ansible-tower/28015/4 "2018-07-11T12:40:29Z")

</div>

This is actually difficult to answer because there are so many ways to do it.

The big question is whether you intend to manage the inventory locally or inside of AWX. If you are primarily managing it locally on your file system, then make a git repo and push it there, and follow the steps that fabiancernota mentioned.

You can also dynamically pull inventory from AWX to use in a local run of ansible-playbook. We have a script in source called tower.py in awx/plugins that has the machinery to be this dynamic inventory source, provided you set some environment vars to define credentials. Soon, an inventory plugin to dynamically source inventory from AWX will make it into Ansible core.

[https://github.com/ansible/ansible/pull/41816](https://github.com/ansible/ansible/pull/41816)

but that’s still a little ways off from being released.
