Can't use Github Enterprise credential in inventory source

200 views
Skip to first unread message

Paul G

unread,
Jul 2, 2021, 1:35:41 PM7/2/21
to AWX Project
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.

Thanks in advance!
Screen Shot 2021-07-02 at 1.33.41 PM.png

Paul G

unread,
Jul 2, 2021, 1:42:07 PM7/2/21
to AWX Project
Sorry, meant AWX 19.2.0

Wei-Yen Tan

unread,
Jul 2, 2021, 5:02:23 PM7/2/21
to Paul G, AWX Project
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

On Sat, 3 Jul 2021 at 05:42, Paul G <lanch...@gmail.com> wrote:
Sorry, meant AWX 19.2.0

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/25e7883b-32be-4a14-88e4-0d8d0efbe831n%40googlegroups.com.

Paul G

unread,
Jul 6, 2021, 1:17:06 PM7/6/21
to AWX Project
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.

Wei-Yen Tan

unread,
Jul 6, 2021, 1:20:47 PM7/6/21
to Paul G, AWX Project
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. 

THEN I add that project to the inventory source. 

I hope that makes sense. :) 

From: awx-p...@googlegroups.com <awx-p...@googlegroups.com> on behalf of Paul G <lanch...@gmail.com>
Sent: Wednesday, July 7, 2021 5:17:06 AM
To: AWX Project <awx-p...@googlegroups.com>
Subject: Re: [awx-project] Re: Can't use Github Enterprise credential in inventory source
 
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.

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.

Paul G

unread,
Jul 6, 2021, 1:24:05 PM7/6/21
to AWX Project
Actually, this is exactly how I have it set up! But still I don't see the actual inventory files when adding it as an inventory source

Wei-Yen Tan

unread,
Jul 6, 2021, 1:24:27 PM7/6/21
to Paul G, AWX Project
Question. 

Have you added the GitHub repo and successfully synced it? 

Is your inventory in yml or ini format? 

From: Wei-Yen Tan <weiye...@gmail.com>
Sent: Wednesday, July 7, 2021 5:20:35 AM
To: Paul G <lanch...@gmail.com>; AWX Project <awx-p...@googlegroups.com>

Subject: Re: [awx-project] Re: Can't use Github Enterprise credential in inventory source

Wei-Yen Tan

unread,
Jul 6, 2021, 1:25:31 PM7/6/21
to Paul G, AWX Project
Are you using ini or yml? 

From: Wei-Yen Tan <weiye...@gmail.com>
Sent: Wednesday, July 7, 2021 5:24:19 AM

Paul G

unread,
Jul 6, 2021, 1:26:44 PM7/6/21
to AWX Project
I have tried ini, but not yaml. I can certainly try that and see if it works any differently.

Paul G

unread,
Jul 6, 2021, 1:27:36 PM7/6/21
to AWX Project
Oh, and yes, the repository has successfully synced :)

Wei-Yen Tan

unread,
Jul 6, 2021, 1:29:30 PM7/6/21
to Paul G, AWX Project
Ok i have used ini and it works. Where did you put The file? Is it possible to see a sample of your layout? 

Sent: Wednesday, July 7, 2021 5:26:44 AM

To: AWX Project <awx-p...@googlegroups.com>
Subject: Re: [awx-project] Re: Can't use Github Enterprise credential in inventory source
I have tried ini, but not yaml. I can certainly try that and see if it works any differently.

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.

Paul G

unread,
Jul 6, 2021, 2:25:17 PM7/6/21
to AWX Project
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:

PLAY [myhost.mydomain.com] ****************************************************
skipping: no hosts matched

PLAY RECAP *********************************************************************

Wei-Yen Tan

unread,
Jul 6, 2021, 2:30:02 PM7/6/21
to Paul G, AWX Project
Yes yoy can  look at inventory at your left. 

Sent: Wednesday, July 7, 2021 6:25:16 AM

To: AWX Project <awx-p...@googlegroups.com>
Subject: Re: [awx-project] Re: Can't use Github Enterprise credential in inventory source
--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.

Paul G

unread,
Jul 6, 2021, 2:35:39 PM7/6/21
to AWX Project
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?

Wei-Yen Tan

unread,
Jul 6, 2021, 2:36:55 PM7/6/21
to Paul G, AWX Project
What is in the job when you sync? 

Sent: Wednesday, July 7, 2021 6:35:39 AM

To: AWX Project <awx-p...@googlegroups.com>
Subject: Re: [awx-project] Re: Can't use Github Enterprise credential in inventory source
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?

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.

Paul G

unread,
Jul 6, 2021, 2:44:02 PM7/6/21
to AWX Project
[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.
ansible-inventory [core 2.12.0.dev0]
config file = None
configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
ansible collection location = /runner/requirements_collections:/home/runner/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible-inventory
python version = 3.8.3 (default, Aug 31 2020, 16:03:14) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
jinja version = 2.10.3
libyaml = True
No config file found; using defaults
host_list declined parsing /runner/project/mit.yml as it did not pass its verify_file() method
script declined parsing /runner/project/mit.yml as it did not pass its verify_file() method
[WARNING]: Skipping 'hosts' as this is not a valid group definition
Parsed /runner/project/mit.yml inventory source with yaml plugin

This is the output when the source syncs. I'm not sure what the verify_file() error means. My yml file takes this format:
hosts:

and so forth. 

Paul G

unread,
Jul 6, 2021, 3:52:18 PM7/6/21
to AWX Project
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!
Reply all
Reply to author
Forward
0 new messages