You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running with newly released version 1.18.0 or current head of dev branch the azure dynamic inventory plugin stops working for us, failing to produce a hostlist from an azure environment and printing an error as ansible warning (see below).
Add azure.azcollection to your collections/requirements.yml and set it explicitly to version 1.18.0 or simply leave version off as buggy version is also current default version.
Try to create a dynamic ansible inventory for your azure environment using your plugin config (of course you must also make sure that azure authing works properly for your setup):
Inventory plugin "scans" our azure environment and creates a matching ansible inventory entry for each vm found.
ACTUAL RESULTS
Inventory plugin fails to create any ansible host automatically from our azure vms and fails with the following error message:
[WARNING]: * Failed to parse
/opt/vstsagent/_work/1/s/inventories/tdcs_azure_machines.azure_rm.yml with auto
plugin: 'AzureRMAuth' object has no attribute 'azure_credentials'
[WARNING]: * Failed to parse
/opt/vstsagent/_work/1/s/inventories/tdcs_azure_machines.azure_rm.yml with yaml
plugin: Plugin configuration YAML file, not YAML inventory
[WARNING]: * Failed to parse
/opt/vstsagent/_work/1/s/inventories/tdcs_azure_machines.azure_rm.yml with ini
plugin: Invalid host pattern '---' supplied, '---' is normally a sign this is a
YAML file.
[WARNING]: Unable to parse
/opt/vstsagent/_work/1/s/inventories/tdcs_azure_machines.azure_rm.yml as an
inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
@all:
|--@ungrouped:
The very first part is imho the important here:
[WARNING]: * Failed to parse
/opt/vstsagent/_work/1/s/inventories/tdcs_azure_machines.azure_rm.yml with auto
plugin: 'AzureRMAuth' object has no attribute 'azure_credentials'
The text was updated successfully, but these errors were encountered:
Be aware that this issue can be somewhat tricky to detect as the plugin failing to create and inventory is only a warning in ansible, not an error, and ansible is also totally fine with running your playbook against an empty host list, so your pipeline will run and will be green, but in reality it just does nothing :)
Using inventory plugin 'ansible_collections.azure.azcollection.plugins.inventory.azure_rm' to process inventory source '/runner/project/inv/dev_servers/azure_rm.yml'
toml declined parsing /runner/project/inv/dev_servers/azure_rm.yml as it did not pass its verify_file() method
[WARNING]: * Failed to parse /runner/project/inv/dev_servers/azure_rm.yml with
auto plugin: 'AzureRMAuth' object has no attribute 'azure_credentials'
File "/usr/local/lib/python3.9/site-packages/ansible/inventory/manager.py", line 293, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/usr/local/lib/python3.9/site-packages/ansible/plugins/inventory/auto.py", line 59, in parse
plugin.parse(inventory, loader, path, cache=cache)
File "/usr/share/ansible/collections/ansible_collections/azure/azcollection/plugins/inventory/azure_rm.py", line 223, in parse
self._credential_setup()
File "/usr/share/ansible/collections/ansible_collections/azure/azcollection/plugins/inventory/azure_rm.py", line 246, in _credential_setup
self._clientconfig = AzureRMRestConfiguration(self.azure_auth.azure_credentials, self.azure_auth.subscription_id,
SUMMARY
When running with newly released version 1.18.0 or current head of dev branch the azure dynamic inventory plugin stops working for us, failing to produce a hostlist from an azure environment and printing an error as ansible warning (see below).
ISSUE TYPE
COMPONENT NAME
azure.azcollection.azure_rm inventory
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Azure Ubuntu Minimal: Ubuntu 22.04.3 LTS (GNU/Linux 6.2.0-1012-azure x86_64)
STEPS TO REPRODUCE
Add azure.azcollection to your
collections/requirements.yml
and set it explicitly to version 1.18.0 or simply leave version off as buggy version is also current default version.Install ansible collections:
Ensure all necessary python deps for plugin to work are installed.
Create a dynamic inventory configuration file fitting your azure environment / subscription like described in the docu for the
plugin: https://docs.ansible.com/ansible/latest/collections/azure/azcollection/azure_rm_inventory.html
Try to create a dynamic ansible inventory for your azure environment using your plugin config (of course you must also make sure that azure authing works properly for your setup):
EXPECTED RESULTS
Inventory plugin "scans" our azure environment and creates a matching ansible inventory entry for each vm found.
ACTUAL RESULTS
Inventory plugin fails to create any ansible host automatically from our azure vms and fails with the following error message:
The very first part is imho the important here:
The text was updated successfully, but these errors were encountered: