I have AWX 19.2.2 set up in k8s using awx-operator and trying to set up a new inventory. The inventory project is created and the Github Enterprise credential is created, and the project syncs correctly. When I create the inventory and set up the source, I have selected “Sourced from a Project” in the Source field. Then I select the appropriate project in the Project field. But in the Credential field, my GHE credential doesn’t show up, and nothing shows up in the “Inventory file” field other than “/ (project root”
I’m not sure what I’m doing wrong here, but we have been using custom inventory scripts in older versions of AWX, so we need some way of generating our inventory outside of more conventional means.
I have never used it like this. All i do is create the project from Project section (using credentials whatever that may be) and then i source it in the Inventory Source. There is no need to add the credentials from the inventory source section
So if you don’t need the github creds, how do you get AWX to see the inventory files in the project? Do they have to be in a specific format? It’s only showing me the project root as a choice.
Create a project of your inventory repository with the project resource. You are adding the credentials in the inventory source section. That’s not how I do it.
In your situation I would add the github repository to the project resource. Then I can add the git credentials as source control.
Well, I created a yml inventory, and it at least syncs now. The project and the inventory source shows a successful sync. However, I wonder if there’s a way to display the inventory because using it to run a job from a template says that there is no matching host for a host that I know is in the inventory file:
Identity added: /runner/artifacts/58/ssh_key_data (/runner/artifacts/58/ssh_key_data)
[WARNING]: You are running the development version of Ansible. You should only
run Ansible from “devel” if you are modifying the Ansible engine, or trying out
features under development. This is a rapidly changing source of code and can
become unstable at any point.
[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match ‘all’
[WARNING]: Could not match supplied host pattern, ignoring: myhost.mydomain.com
PLAY [myhost.mydomain.com] ****************************************************
skipping: no hosts matched
PLAY RECAP *********************************************************************
I see. So maybe it’s not syncing properly now, because in the inventory, the list of hosts is empty, despite the inventory yaml file having >600 hostnames in it. The hosts should be populated dynamically?
An update, I retried using an ini file, and this time it worked! Possibly I had a misconfiguration last time I used it. At any rate, thank you for your help!