skip to Main Content

SUMMARY:
I has done the installation ansible-awx follow the instruction:
https://howto.lintel.in/install-ansible-tower-awx-centos-7/

ISSUE TYPE :

When i ran command ansible-playbook -i inventory install.yml -vv
in folder source awx /root/awx/installer

Bug Report :

TASK [local_docker : Start the containers] ********************************************************************************************************************************
task path: /root/awx/installer/roles/local_docker/tasks/compose.yml:39
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (Docker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on ansible-awx’s Python /bin/python3. Please read module documentation and install 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 or pip install docker-py (Python 2.6). The error was: No module named ‘requests’"}

PLAY RECAP ****************************************************************************************************************************************************************
localhost : ok=13 changed=2 unreachable=0 failed=1 skipped=86 rescued=0 ignored=0

I try ran command with : ansible-playbook -i inventory install.yml -e ‘ansible_python_interpreter=/usr/bin/python3’
But error the error appears similar above .

ANSIBLE VERSION

ansible 2.9.10
config file = /etc/ansible/ansible.cfg
configured module search path = [u’/root/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’] ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /bin/ansible
python version = 2.7.5 (default, Apr 2 2020, 13:16:51) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

OS: CentOS Linux release 7.8.2003 (Core)

Thanks for helping !

2

Answers


  1. I’ve got the same error and I solved it installing python36-docker and docker-componse.

    yum install python3 python36-docker -y
    pip3 install docker-compose
    

    then rerun:

    ansible-playbook -i inventory install.yml
    
    Login or Signup to reply.
  2. I run into the same issue, the following command executed on managed node (host) helped:

    $ pip3 install docker
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search