# project inventory source - overwrite variables

**URL:** <https://forum.ansible.com/t/project-inventory-source-overwrite-variables/29343>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [December 31, 2018, 10:03pm UTC](https://forum.ansible.com/t/project-inventory-source-overwrite-variables/29343 "2018-12-31T22:03:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam\_E](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@Adam\_E](https://forum.ansible.com/u/Adam_E)\
**Post date:** [December 31, 2018, 10:03pm UTC](https://forum.ansible.com/t/project-inventory-source-overwrite-variables/29343/1 "2018-12-31T22:03:51Z")

</div>

Hi there.

My use case is that I have satellite6 as my primary dynamic inventory source. When I have specific host\_vars/group\_vars variables that I want to set, my original thought was that I would combine the satellite dynamic inventory with a project/git based dynamic inventory (ie, two distinct sources on one inventory). This way I would have a versioned history of all the changes made to the host\_vars/group\_vars configuration through a git based project.

Unfortunately I have found that when using a “project” based dynamic inventory, the “overwrite variables” is hard coded to yes in the AWX UI. Therefore whenever the sync runs for the project/git inventory it overwrites all of the variable configuration that was brought in by the satellite dynamic inventory.

So wondering if anyone can provide some insights, specifically:

1. Why is the project/git based inventory hard coded to “overwrite variables”? is there some type of limitation? It would be nice if it could “merge” similar to the other dynamic inventories. Should I create a feature request? I could assist with the implementation if there’s no reason not to do it.

2. What are others that are using satellite as a dynamic inventory doing for custom host/group attributes. As of now, the only option would be to manually set them in awx, however I would really like to have version history of my host & group vars in the event something goes wrong.  
On the best [practices page](https://docs.ansible.com/ansible-tower/latest/html/userguide/best_practices.html#variable-management-for-inventory) it does mention to use AWX to set host/group vars, but it also mentions use source control as another best practices, so it’s a little bit conflicting. I assume others can see the benefit of having your host/group vars source controlled?

Would appreciate any thoughts from others on this.

thanks.

---

<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:** [January 2, 2019, 1:08pm UTC](https://forum.ansible.com/t/project-inventory-source-overwrite-variables/29343/2 "2019-01-02T13:08:16Z")

</div>

There is a proposed patch to make it no longer hard coded.

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

There was an issue with group\_vars not loading in expected location, which was resolved on the Ansible core side by adding the --export flag to the command, and all those changes have been synced up by now… but potential versioning issues concerned us so we kept the guard rails for a few releases afterwards.

---

<div class="post-metadata">

**Author:** ![Adam\_E](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@Adam\_E](https://forum.ansible.com/u/Adam_E)\
**Post date:** [January 2, 2019, 4:44pm UTC](https://forum.ansible.com/t/project-inventory-source-overwrite-variables/29343/3 "2019-01-02T16:44:19Z")

</div>

that’s great news Alan, thank you.

Wondering if you are aware of a workaround until the patch is merged. I am running in docker, so ideally if there was a workaround that did not involve building a custom image, that would be great.

I also added a comment to the underlying issue to hopefully move it along.  
[https://github.com/ansible/awx/issues/1271](https://github.com/ansible/awx/issues/1271)
