New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change how multiple inventory sources are synced #3769
Comments
hi @wenottingham , I just ran into #1997 and was wondering if when this feature is implemented it may also delete the no longer used group_vars/all from the inventory if the |
Possibly doable with this, yes. |
We also ran into the same problem while refactoring our inventory. It's very confusing and dangerous that deletion of variables in group_vars/all doesn't propagate to the inventory. I suggest to increase priority on this issue. |
Echoing what @abedwardsw stated on overwriting the global vars.
|
Adding to @joshmullis checkboxes (for inventory sourced from project)::
This would remove the workaround of having an dummy inventory file listing just the groups that should be extended by the projects groupvars: [webservers]
[databases]
[jumphosts] Come to think about it, in the dropdown: add the "just source grup_vars" so one doesn't have to use the workaround above at all. And: adding a priority setting would be nice. So one still can have inventory source 3 overwriting the merged (-i s1 -i s2) sources with a lower priority. |
+1 |
+1 |
I got a behaviour which seems relevant as well. I'm creating about 10 azurerm inventory sources in the same inventory with some conditional groups which will create me one group per OS type (windows/linux). In the windows one, I put the relevant winrm variables to allow the connections to windows host work from the same templates as linux. This inventory typically syncs on each job execution Randomly, these variables are wiped. I don't know how or why exactly, as I haven't managed to replicate it. But I will notice it when my jobs against windows hosts start failing because they're trying to ssh to them. I opened a case with RH which redirected me to this issue. |
ISSUE TYPE
SUMMARY
Currently, if you have multiple inventory sources for an inventory, they are synced individually.
This leads to:
We should move to not doing individual inventory source syncs. Instead, we should, when an inventory is synced, run a single
ansible-inventory
process passing all inventory sources.Note: this will be a behavior change that will change how inventory is computed. It will also change the mechanism such that "overwrite" and "overwrite vars" should not be used for individual sources.
The text was updated successfully, but these errors were encountered: