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

Failed to import the required Python library (azure.core.exceptions) #219

Open
1 task done
felipenazario opened this issue Aug 30, 2024 · 0 comments
Open
1 task done

Comments

@felipenazario
Copy link

felipenazario commented Aug 30, 2024

Summary

I am trying to collect account information using the task digitalocean.cloud.account_info, it works flawless when I use community.digitalocean.digital_ocean_account_info.

Issue Type

Bug Report

Component Name

digitalocean.cloud.account_info

Ansible Version

ansible [core 2.16.10]
  config file = /home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg
  configured module search path = ['/home/marcos/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/marcos/desenvolvimento/workspace_infra/home_server_docker/.pyenv_for_3.12.5/lib/python3.12/site-packages/ansible
  ansible collection location = /opt/ansible/collections:/home/marcos/desenvolvimento/workspace_infra/home_server_docker/collections
  executable location = /home/marcos/desenvolvimento/workspace_infra/home_server_docker/.pyenv_for_3.12.5/bin/ansible
  python version = 3.12.5 (main, Aug 12 2024, 11:29:32) [GCC 7.5.0] (/home/marcos/desenvolvimento/workspace_infra/home_server_docker/.pyenv_for_3.12.5/bin/python)
  jinja version = 3.1.4
  libyaml = True

Configuration

ANSIBLE_PIPELINING(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = True
CALLBACKS_ENABLED(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = ['ansible.posix.timer', 'ansible.posix.profile_roles', 'ansible.posix.profile_tasks'>
COLLECTIONS_PATHS(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = ['/opt/ansible/collections', '/home/marcos/desenvolvimento/workspace_infra/home_serv>
CONFIG_FILE() = /home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg
DEFAULT_FORKS(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = 10
DEFAULT_HOST_LIST(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = ['/home/marcos/desenvolvimento/workspace_infra/home_server_docker/inventories/test/h>
DEFAULT_PRIVATE_ROLE_VARS(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = True
DEFAULT_REMOTE_PORT(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = 22
DEFAULT_ROLES_PATH(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = ['/opt/ansible/roles', '/home/marcos/desenvolvimento/workspace_infra/home_server_do>
DEFAULT_TIMEOUT(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = 15
DEPRECATION_WARNINGS(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = True
HOST_KEY_CHECKING(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = False
PAGER(env: PAGER) = less

CONNECTION:
==========

local:
_____
pipelining(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = True

paramiko_ssh:
____________
host_key_checking(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = False
port(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = 22
timeout(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = 15

psrp:
____
pipelining(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = True

ssh:
___
host_key_checking(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = False
pipelining(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = True
port(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = 22
timeout(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = 15

winrm:
_____
pipelining(/home/marcos/desenvolvimento/workspace_infra/home_server_docker/ansible.cfg) = True

OS / Environment

$ cat /etc/os-release

NAME="openSUSE Leap"
VERSION="15.3"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.3"
PRETTY_NAME="openSUSE Leap 15.3"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.3"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"

Steps to Reproduce

- name: Get account information
  digitalocean.cloud.account_info:
    token: "{{ lookup('file', './keys/digitalocean/token.txt') }}"
  register: customer_info

- name: "Show info."
  ansible.builtin.debug:
    msg: "{{ customer_info }}"

Expected Results

I expect the cloud response, but it does not.

Actual Results

I run the playbook that has only the two tasks above, it shows the error:

{"changed": false, "msg": "Failed to import the required Python library (azure.core.exceptions) on localhost.localdomain'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"}

I have installed this version of the collection:

Collection                               Version
---------------------------------------- -------
ansible.posix                            1.5.4
digitalocean.cloud                       0.6.0

I tried using this version of python libs:

azure-core                1.26.1
boto3                     1.28.53
pydo                      0.1.7

I also tried using this version of python libs:

azure-core                1.30.2
azure-identity            1.17.1
boto3                     1.35.9
botocore                  1.35.9
pydo                      0.4.0

But nothing works.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
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

No branches or pull requests

1 participant