Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Azure pb is failing to get ph_password from Vault #30

Closed
NeckBeardPrince opened this issue Dec 26, 2021 · 2 comments · Fixed by #31
Closed

Azure pb is failing to get ph_password from Vault #30

NeckBeardPrince opened this issue Dec 26, 2021 · 2 comments · Fixed by #31

Comments

@NeckBeardPrince
Copy link

NeckBeardPrince commented Dec 26, 2021

This is happening on brand new installs and when running as an update for pihole.

Edit: The issue seems to be with using the https://raw.githubusercontent.com/ansible-collections/azure/dev/requirements-azure.txt. There was an update a few days ago that broke this, I swapped the dev branch for the commit from a few days ago and it works fine. https://raw.githubusercontent.com/ansible-collections/azure/fbfe197215f74d271a448161b5b499151e261d39/requirements-azure.txt

TASK [Get ph_password from Azure Vault Secret] *********************************
task path: /opt/cloudblock/playbooks/cloudblock_azure.yml:86
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1640550184.5302355-19419-194224603752523 `" && echo ansible-tmp-1640550184.5302355-19419-194224603752523="` echo /root/.ansible/tmp/ansible-tmp-1640550184.5302355-19419-194224603752523 `" ) && sleep 0'
Using module file /root/.ansible/collections/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultsecret_info.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-18679q0jpd26e/tmpic8_9fj3 TO /root/.ansible/tmp/ansible-tmp-1640550184.5302355-19419-194224603752523/AnsiballZ_azure_rm_keyvaultsecret_info.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1640550184.5302355-19419-194224603752523/ /root/.ansible/tmp/ansible-tmp-1640550184.5302355-19419-194224603752523/AnsiballZ_azure_rm_keyvaultsecret_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1640550184.5302355-19419-194224603752523/AnsiballZ_azure_rm_keyvaultsecret_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1640550184.5302355-19419-194224603752523/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_azure_rm_keyvaultsecret_info_payload_nh1bkfmr/ansible_azure_rm_keyvaultsecret_info_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py", line 235, in <module>
    from azure.mgmt.monitor.version import VERSION as monitor_client_version
ModuleNotFoundError: No module named 'azure.mgmt.monitor.version'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "ad_user": null,
            "adfs_authority_url": null,
            "api_profile": "latest",
            "auth_source": "msi",
            "cert_validation_mode": null,
            "client_id": null,
            "cloud_environment": "AzureCloud",
            "log_mode": null,
            "log_path": null,
            "name": "cloudblock-secret",
            "password": null,
            "profile": null,
            "secret": null,
            "show_deleted_secret": false,
            "subscription_id": null,
            "tags": null,
            "tenant": null,
            "vault_uri": "https://cloudblock-secret-d070s.vault.azure.net",
            "version": "current"
        }
    },
    "msg": "Failed to import the required Python library (ansible[azure] (azure >= 2.0.0)) on cloudblock-instance's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"
}
@chadgeary
Copy link
Owner

Looks like an issue was opened for it upstream: ansible-collections/azure#715

@l3ender
Copy link
Contributor

l3ender commented Dec 28, 2021

I've posted detail in the upstream issue on why this is occurring; see ansible-collections/azure#715 (comment).

However, I think a change in this project should be made to ensure the same requirements as the collection version are installed. I've opened #31, but don't use this project so would need assistance testing/validating.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants