cancel
Showing results for 
Search instead for 
Did you mean: 
yamen
Cadet
Cadet
  • 1,059 Views

install python libraries executive environment

Jump to solution

hi everyone

Im facing a problem running a playbook contains the community.docker.docker_swarm module using ansible-navigator. 

I get the error when I run the module telling that I need to install the docker python library : 

FAILED! => {"changed": false, "msg": "Failed to import the required Python library (Docker SDK for Python: docker>=5.0.0 (Python >= 3.6) or docker<5.0.0 (Python 2.7)) on Host'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, for example via `pip install docker` (Python >= 3.6) or `pip install docker==4.4.4` (Python 2.7). The error was: No module named 'docker'"}

 

The problem is that when I run the command directly, the library get installed on my host python interpreter and NOT on the executive environment.

 

So the question is, how can I add python liberaries to the Ansible executive environment?

1 Solution

Accepted Solutions
Fran_Garcia
Starfighter Starfighter
Starfighter
  • 1,007 Views

The name is "Execution Environment". You can find how to customize them in the official AAP documentation: https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.4/html/creating_and_c...

 

Pay attention to the "Using Ansible Builder" chapter; you need to specify your required pip modules in the "dependencies" , "python" area: https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.4/html/creating_and_c...

 

Once you build your EE, you need to change the config of ansible-navigator so it uses the new EE.

 

View solution in original post

1 Reply
Fran_Garcia
Starfighter Starfighter
Starfighter
  • 1,008 Views

The name is "Execution Environment". You can find how to customize them in the official AAP documentation: https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.4/html/creating_and_c...

 

Pay attention to the "Using Ansible Builder" chapter; you need to specify your required pip modules in the "dependencies" , "python" area: https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.4/html/creating_and_c...

 

Once you build your EE, you need to change the config of ansible-navigator so it uses the new EE.

 

Join the discussion
You must log in to join this conversation.