Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Updated requirements.txt to include libraries for azure_rm collection #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nickzer0
Copy link

I was getting some errors when trying to provision the VM's with local exec:

null_resource.provision_workstation_once_dc_has_been_created: Provisioning with 'local-exec'...
null_resource.provision_workstation_once_dc_has_been_created (local-exec): Executing: ["/bin/sh" "-c" "/bin/bash -c 'source venv/bin/activate && ansible-playbook workstations.yml -v'"]
null_resource.provision_workstation_once_dc_has_been_created (local-exec): /Users/nick/Documents/Code/Infrastructure/Adaz/ansible/venv/lib/python3.10/site-packages/paramiko/pkey.py:82: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
null_resource.provision_workstation_once_dc_has_been_created (local-exec):   "cipher": algorithms.TripleDES,
null_resource.provision_workstation_once_dc_has_been_created (local-exec): /Users/nick/Documents/Code/Infrastructure/Adaz/ansible/venv/lib/python3.10/site-packages/paramiko/transport.py:253: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
null_resource.provision_workstation_once_dc_has_been_created (local-exec):   "class": algorithms.TripleDES,
null_resource.provision_workstation_once_dc_has_been_created (local-exec): Using /Users/nick/Documents/Code/Infrastructure/Adaz/ansible/ansible.cfg as config file
null_resource.provision_workstation_once_dc_has_been_created (local-exec): [WARNING]:  * Failed to parse
null_resource.provision_workstation_once_dc_has_been_created (local-exec): /Users/nick/Documents/Code/Infrastructure/Adaz/ansible/inventory_azure_rm.yml
null_resource.provision_workstation_once_dc_has_been_created (local-exec): with auto plugin: Azure CLI profile cannot be loaded - User
null_resource.provision_workstation_once_dc_has_been_created (local-exec): 'my@email.com' does not exist in MSAL token cache. Run `az login`.
null_resource.provision_workstation_once_dc_has_been_created (local-exec): [WARNING]:  * Failed to parse
null_resource.provision_workstation_once_dc_has_been_created (local-exec): /Users/nick/Documents/Code/Infrastructure/Adaz/ansible/inventory_azure_rm.yml
null_resource.provision_workstation_once_dc_has_been_created (local-exec): with yaml plugin: Plugin configuration YAML file, not YAML inventory
null_resource.provision_workstation_once_dc_has_been_created (local-exec): [WARNING]:  * Failed to parse
null_resource.provision_workstation_once_dc_has_been_created (local-exec): /Users/nick/Documents/Code/Infrastructure/Adaz/ansible/inventory_azure_rm.yml
null_resource.provision_workstation_once_dc_has_been_created (local-exec): with ini plugin: Invalid host pattern 'plugin:' supplied, ending in ':' is not
null_resource.provision_workstation_once_dc_has_been_created (local-exec): allowed, this character is reserved to provide a port.
null_resource.provision_workstation_once_dc_has_been_created (local-exec): [WARNING]: Unable to parse
null_resource.provision_workstation_once_dc_has_been_created (local-exec): /Users/nick/Documents/Code/Infrastructure/Adaz/ansible/inventory_azure_rm.yml
null_resource.provision_workstation_once_dc_has_been_created (local-exec): as an inventory source
null_resource.provision_workstation_once_dc_has_been_created (local-exec): [WARNING]: No inventory was parsed, only implicit localhost is available
null_resource.provision_workstation_once_dc_has_been_created (local-exec): [WARNING]: provided hosts list is empty, only localhost is available. Note that
null_resource.provision_workstation_once_dc_has_been_created (local-exec): the implicit localhost does not match 'all'
null_resource.provision_workstation_once_dc_has_been_created (local-exec): [WARNING]: Could not match supplied host pattern, ignoring: workstations

I managed to isolate the error to this file:

ansible-inventory -i inventory_azure_rm.yml --list

[WARNING]: Collection azure.azcollection does not support Ansible version 2.12.10
[WARNING]:  * Failed to parse /Users/nick/Documents/Code/Infrastructure/Adaz/ansible/inventory_azure_rm.yml with auto plugin: Azure CLI profile cannot be loaded - User 'nick.pearce@maplequad.com' does not exist in MSAL token cache. Run `az login`.
[WARNING]:  * Failed to parse /Users/nick/Documents/Code/Infrastructure/Adaz/ansible/inventory_azure_rm.yml with yaml plugin: Plugin configuration YAML file, not YAML inventory
[WARNING]:  * Failed to parse /Users/nick/Documents/Code/Infrastructure/Adaz/ansible/inventory_azure_rm.yml with ini plugin: Invalid host pattern 'plugin:' supplied, ending in ':' is not allowed, this character is reserved to provide a port.
[WARNING]: Unable to parse /Users/nick/Documents/Code/Infrastructure/Adaz/ansible/inventory_azure_rm.yml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
{
    "_meta": {
        "hostvars": {}
    },
    "all": {
        "children": [
            "ungrouped"
        ]
    }
}

After some research, I found the "azure_rm" Ansible collection has it's own set of Python requirements that aren't automatically installed in the virtual environment. The list of them can be found here:
~/.ansible/collections/ansible_collections/azure/azcollection/requirements.txt

I fixed the issue with installing them with pip, but have included them in this PR.

….ansible/collections/ansible_collections/azure/azcollection/requirements.txt
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant