On Wed, 18 Jan 2023 at 14:11, abhay srivastava <[email protected]>
wrote:
>
> Hello all,
>
> We are facing one issue with dynamic inventory of azure.
>
> Getting below error
>
> ansible-inventory -i test.azure_rm.yaml --graph -vvv
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *ansible-inventory [core 2.13.7]config file =
> /etc/ansible/ansible.cfgconfigured module search path =
> ['/root/.ansible/plugins/modules',
> '/usr/share/ansible/plugins/modules']ansible python module location =
> /usr/lib/python3/dist-packages/ansibleansible collection location =
> /root/.ansible/collections:/usr/share/ansible/collectionsexecutable
> location = /usr/bin/ansible-inventorypython version = 3.10.6 (main, Nov 14
> 2022, 16:10:14) [GCC 11.3.0]jinja version = 3.0.3libyaml = TrueUsing
> /etc/ansible/ansible.cfg as config filehost_list declined parsing
> /root/test.azure_rm.yaml as it did not pass its verify_file() methodscript
> declined parsing /root/test.azure_rm.yaml as it did not pass its
> verify_file() methodUsing inventory plugin
> 'ansible_collections.azure.azcollection.plugins.inventory.azure_rm' to
> process inventory source '/root/test.azure_rm.yaml'toml declined parsing
> /root/test.azure_rm.yaml as it did not pass its verify_file()
> method[WARNING]: * Failed to parse /root/test.azure_rm.yaml with auto
> plugin: Failed to get credentials. Either pass asparameters, set
> environment variables, define a profile in ~/.azure/credentials, or install
> Azure CLI and log in (az login).File
> "/usr/lib/python3/dist-packages/ansible/inventory/manager.py", line 290, in
> parse_sourceplugin.parse(self._inventory, self._loader, source,
> cache=cache)File
> "/usr/lib/python3/dist-packages/ansible/plugins/inventory/auto.py", line
> 59, in parseplugin.parse(inventory, loader, path, cache=cache)File
> "/root/.ansible/collections/ansible_collections/azure/azcollection/plugins/inventory/azure_rm.py",
> line 220, in parseself._credential_setup()File
> "/root/.ansible/collections/ansible_collections/azure/azcollection/plugins/inventory/azure_rm.py",
> line 241, in _credential_setupself.azure_auth =
> AzureRMAuth(**auth_options)File
> "/root/.ansible/collections/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py",
> line 1479, in initself.fail("Failed to get credentials. Either pass as
> parameters, set environment variables, "File
> "/root/.ansible/collections/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py",
> line 1605, in failself._fail_impl(msg)File
> "/root/.ansible/collections/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py",
> line 1608, in _default_fail_implraise AzureRMAuthException(msg)[WARNING]: *
> Failed to parse /root/test.azure_rm.yaml with yaml plugin: Plugin
> configuration YAML file, not YAML inventoryFile
> "/usr/lib/python3/dist-packages/ansible/inventory/manager.py", line 290, in
> parse_sourceplugin.parse(self._inventory, self._loader, source,
> cache=cache)File
> "/usr/lib/python3/dist-packages/ansible/plugins/inventory/yaml.py", line
> 114, in parseraise AnsibleParserError('Plugin configuration YAML file, not
> YAML inventory')[WARNING]: * Failed to parse /root/test.azure_rm.yaml with
> ini plugin: Invalid host pattern 'plugin:' supplied, ending in':' is not
> allowed, this character is reserved to provide a port.File
> "/usr/lib/python3/dist-packages/ansible/inventory/manager.py", line 290, in
> parse_sourceplugin.parse(self._inventory, self._loader, source,
> cache=cache)File
> "/usr/lib/python3/dist-packages/ansible/plugins/inventory/ini.py", line
> 136, in parseraise AnsibleParserError(e)[WARNING]: Unable to parse
> /root/test.azure_rm.yaml as an inventory source[WARNING]: No inventory was
> parsed, only implicit localhost is available@all:|--@ungrouped:*
>
> Able to do az vm list
> az vm list | wc -l
> 1341
> my azure inventory is below
> cat test.azure_rm.yaml
> plugin: azure.azcollection.azure_rm
> auth_source: auto
> include_vm_resource_groups:
> - '*'
> vars:
> ansible_python_interpreter: /usr/bin/python3
>
>
> --
> Regards,
> Abhay Srivastava
> ---------------------------
> Mob-9160512000
>
--
Regards,
Abhay Srivastava
---------------------------
Mob-9160512000
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAPKgz8Ur02aSos3A1v%2Bsg%2B2fHzaUWepPDXvFyqgmxXyCmTTzHg%40mail.gmail.com.