Standard CLI Ansible looks for the group_vars
and host_vars
directory in the same location as the host file. See for example How can I change the path of group_vars and host_vars?.
Ansible AWX / Tower has the option of using an "external source" for inventory. When I add the URL of my Git repo I can select the host file or root.
I tried a configuration with a host file in the root and a configuration with the host file in a sub directory. With both options the directories group_vars
and host_vars
are ignored as far as I can tell.
The documentation is a bit vague on the issue.
Keeping variable data along with the objects in Tower (see the inventory editor) is encouraged, rather than using group_vars/ and host_vars/. If you use dynamic inventory sources, Tower can sync such variables with the database as long as the Overwrite Variables option is not set. 26. Best Practices — Ansible Tower User Guide v3.7.0
Can Tower / AWX sync those variables? Variables in group_vars
and / or host_vars
? Or is this sync ability limited to the host file?
If it is possible, how should this work?
It seems that Ansible AWX / Tower is a one way street. If you want to use AWX you have to migrate the group_vars
and host_vars
directories to AWX / Tower and after that there is no way back?
An Ansible project can work with standard CLI Ansible or AWX / Tower - not both!?