Unable to Load Inventory from Azure

95 views
Skip to first unread message

Nigel M

unread,
Sep 19, 2017, 5:10:22 PM9/19/17
to AWX Project
Evaluating AWX and just got it installed. Set up Azure (Microsoft Azure Resource Manager) as a an Inventory Source and attempting to sync. It appears to be connecting ok, but AWX is saying we don't have any hosts. We have a few hundred on this Azure account. Here are the logs from the sync job: 2017-09-19 20:45:51,675 INFO awx.main.commands.inventory_import Updating inventory 4: azure-prd9 2017-09-19 20:45:51,692 INFO awx.main.commands.inventory_import Reading Ansible inventory source: /usr/lib/python2.7/site-packages/awx/plugins/inventory/azure_rm.py 2017-09-19 20:45:58,095 INFO awx.main.commands.inventory_import Processing JSON output... 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Loaded group: all 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Loaded group: azure 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Adding child group azure to parent all 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Adding child group azure to parent all 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Finished loading from source: /usr/lib/python2.7/site-packages/awx/plugins/inventory/azure_rm.py 2017-09-19 20:45:58,096 DEBUG awx.main.commands.inventory_import Removing empty group azure 2017-09-19 20:45:58,096 INFO awx.main.commands.inventory_import Loaded 0 groups, 0 hosts 2017-09-19 20:45:58,178 INFO awx.main.commands.inventory_import Inventory variables unmodified 2017-09-19 20:45:58,181 DEBUG awx.main.models.inventory Going to update inventory computed fields 2017-09-19 20:45:58,217 DEBUG awx.main.models.inventory Finished updating inventory computed fields 2017-09-19 20:45:58,218 INFO awx.main.commands.inventory_import Inventory import completed for azure-prd9 in 6.5s Am I missing something? Thanks!

Matthew Jones

unread,
Sep 19, 2017, 9:05:55 PM9/19/17
to Nigel M, AWX Project
azure can be a little picky in it's configuration. Can you get the expected results if you run the standalone inventory script (which is what awx itself uses): http://docs.ansible.com/ansible/latest/guide_azure.html#dynamic-inventory-script

On Tue, Sep 19, 2017 at 5:10 PM, Nigel M <nmclo...@gmail.com> wrote:
Evaluating AWX and just got it installed. Set up Azure (Microsoft Azure Resource Manager) as a an Inventory Source and attempting to sync. It appears to be connecting ok, but AWX is saying we don't have any hosts. We have a few hundred on this Azure account. Here are the logs from the sync job: 2017-09-19 20:45:51,675 INFO awx.main.commands.inventory_import Updating inventory 4: azure-prd9 2017-09-19 20:45:51,692 INFO awx.main.commands.inventory_import Reading Ansible inventory source: /usr/lib/python2.7/site-packages/awx/plugins/inventory/azure_rm.py 2017-09-19 20:45:58,095 INFO awx.main.commands.inventory_import Processing JSON output... 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Loaded group: all 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Loaded group: azure 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Adding child group azure to parent all 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Adding child group azure to parent all 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Finished loading from source: /usr/lib/python2.7/site-packages/awx/plugins/inventory/azure_rm.py 2017-09-19 20:45:58,096 DEBUG awx.main.commands.inventory_import Removing empty group azure 2017-09-19 20:45:58,096 INFO awx.main.commands.inventory_import Loaded 0 groups, 0 hosts 2017-09-19 20:45:58,178 INFO awx.main.commands.inventory_import Inventory variables unmodified 2017-09-19 20:45:58,181 DEBUG awx.main.models.inventory Going to update inventory computed fields 2017-09-19 20:45:58,217 DEBUG awx.main.models.inventory Finished updating inventory computed fields 2017-09-19 20:45:58,218 INFO awx.main.commands.inventory_import Inventory import completed for azure-prd9 in 6.5s Am I missing something? Thanks!

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/fa758ab8-0e53-44a2-9814-6f5b4232a648%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Jones
Principal Software Engineer
Ansible Tower

Nigel M

unread,
Sep 20, 2017, 11:33:59 AM9/20/17
to AWX Project
Thanks, I was able to run the command manually without any issues. Perhaps there is a way for me to enable more detailed logging? Thanks again.


On Tuesday, September 19, 2017 at 9:05:55 PM UTC-4, Matthew Jones wrote:
azure can be a little picky in it's configuration. Can you get the expected results if you run the standalone inventory script (which is what awx itself uses): http://docs.ansible.com/ansible/latest/guide_azure.html#dynamic-inventory-script
On Tue, Sep 19, 2017 at 5:10 PM, Nigel M <nmclo...@gmail.com> wrote:
Evaluating AWX and just got it installed. Set up Azure (Microsoft Azure Resource Manager) as a an Inventory Source and attempting to sync. It appears to be connecting ok, but AWX is saying we don't have any hosts. We have a few hundred on this Azure account. Here are the logs from the sync job: 2017-09-19 20:45:51,675 INFO awx.main.commands.inventory_import Updating inventory 4: azure-prd9 2017-09-19 20:45:51,692 INFO awx.main.commands.inventory_import Reading Ansible inventory source: /usr/lib/python2.7/site-packages/awx/plugins/inventory/azure_rm.py 2017-09-19 20:45:58,095 INFO awx.main.commands.inventory_import Processing JSON output... 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Loaded group: all 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Loaded group: azure 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Adding child group azure to parent all 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Adding child group azure to parent all 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Finished loading from source: /usr/lib/python2.7/site-packages/awx/plugins/inventory/azure_rm.py 2017-09-19 20:45:58,096 DEBUG awx.main.commands.inventory_import Removing empty group azure 2017-09-19 20:45:58,096 INFO awx.main.commands.inventory_import Loaded 0 groups, 0 hosts 2017-09-19 20:45:58,178 INFO awx.main.commands.inventory_import Inventory variables unmodified 2017-09-19 20:45:58,181 DEBUG awx.main.models.inventory Going to update inventory computed fields 2017-09-19 20:45:58,217 DEBUG awx.main.models.inventory Finished updating inventory computed fields 2017-09-19 20:45:58,218 INFO awx.main.commands.inventory_import Inventory import completed for azure-prd9 in 6.5s Am I missing something? Thanks!

--
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 post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/fa758ab8-0e53-44a2-9814-6f5b4232a648%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matthew Jones

unread,
Sep 20, 2017, 1:52:43 PM9/20/17
to Nigel M, AWX Project
Which inventory script did you use to test with on Ansible itself?

To unsubscribe from this group and stop receiving emails from it, send an email to awx-project+unsubscribe@googlegroups.com.

To post to this group, send email to awx-p...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Nigel M

unread,
Sep 20, 2017, 3:21:45 PM9/20/17
to AWX Project
I ran azure_rm.py


On Wednesday, September 20, 2017 at 1:52:43 PM UTC-4, Matthew Jones wrote:
Which inventory script did you use to test with on Ansible itself?
On Wed, Sep 20, 2017 at 11:33 AM, Nigel M <nmclo...@gmail.com> wrote:
Thanks, I was able to run the command manually without any issues. Perhaps there is a way for me to enable more detailed logging? Thanks again.

On Tuesday, September 19, 2017 at 9:05:55 PM UTC-4, Matthew Jones wrote:
azure can be a little picky in it's configuration. Can you get the expected results if you run the standalone inventory script (which is what awx itself uses): http://docs.ansible.com/ansible/latest/guide_azure.html#dynamic-inventory-script

On Tue, Sep 19, 2017 at 5:10 PM, Nigel M <nmclo...@gmail.com> wrote:
Evaluating AWX and just got it installed. Set up Azure (Microsoft Azure Resource Manager) as a an Inventory Source and attempting to sync. It appears to be connecting ok, but AWX is saying we don't have any hosts. We have a few hundred on this Azure account. Here are the logs from the sync job: 2017-09-19 20:45:51,675 INFO awx.main.commands.inventory_import Updating inventory 4: azure-prd9 2017-09-19 20:45:51,692 INFO awx.main.commands.inventory_import Reading Ansible inventory source: /usr/lib/python2.7/site-packages/awx/plugins/inventory/azure_rm.py 2017-09-19 20:45:58,095 INFO awx.main.commands.inventory_import Processing JSON output... 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Loaded group: all 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Loaded group: azure 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Adding child group azure to parent all 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Adding child group azure to parent all 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory_import Finished loading from source: /usr/lib/python2.7/site-packages/awx/plugins/inventory/azure_rm.py 2017-09-19 20:45:58,096 DEBUG awx.main.commands.inventory_import Removing empty group azure 2017-09-19 20:45:58,096 INFO awx.main.commands.inventory_import Loaded 0 groups, 0 hosts 2017-09-19 20:45:58,178 INFO awx.main.commands.inventory_import Inventory variables unmodified 2017-09-19 20:45:58,181 DEBUG awx.main.models.inventory Going to update inventory computed fields 2017-09-19 20:45:58,217 DEBUG awx.main.models.inventory Finished updating inventory computed fields 2017-09-19 20:45:58,218 INFO awx.main.commands.inventory_import Inventory import completed for azure-prd9 in 6.5s Am I missing something? Thanks!

--
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 post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/fa758ab8-0e53-44a2-9814-6f5b4232a648%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Jones
Principal Software Engineer
Ansible Tower

--
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 post to this group, send email to awx-p...@googlegroups.com.

Matthew Jones

unread,
Sep 20, 2017, 3:30:57 PM9/20/17
to Nigel M, AWX Project
Testing it here it looks like it works for us. Without some more details on your authentication method and what you put in your .ini file and environment it's hard to see where things are going wrong.

To unsubscribe from this group and stop receiving emails from it, send an email to awx-project+unsubscribe@googlegroups.com.

To post to this group, send email to awx-p...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Nigel M

unread,
Sep 20, 2017, 9:33:38 PM9/20/17
to AWX Project
I got it to work. I found that when I select region as "All", it does not work. Specifying a single region or multiple individual regions and it will work.

Thanks for the help.

Matthew Jones

unread,
Sep 20, 2017, 10:06:35 PM9/20/17
to Nigel M, AWX Project
That's very interesting, let me see what's up with that.

To unsubscribe from this group and stop receiving emails from it, send an email to awx-project+unsubscribe@googlegroups.com.

To post to this group, send email to awx-p...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ryan Petrello

unread,
Sep 21, 2017, 3:07:25 PM9/21/17
to AWX Project
Nigel,

It looks like you've found a bug in awx!  The good news is that it should be pretty simple to fix - I'm taking a look at it now.

In the meantime, your workaround (removing the region entirely) should accomplish what you're looking for.

Thanks!

Nigel M

unread,
Sep 21, 2017, 4:20:20 PM9/21/17
to AWX Project
Cool. Shall I open a bug for you guys?

Matthew Jones

unread,
Sep 21, 2017, 4:35:10 PM9/21/17
to Nigel M, AWX Project
We'll pick up the changes from our downstream hardening in a few days, so not strictly necessary.

To unsubscribe from this group and stop receiving emails from it, send an email to awx-project+unsubscribe@googlegroups.com.

To post to this group, send email to awx-p...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages