Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

docker-compose #30

Closed
hhouissa opened this issue Nov 15, 2019 · 9 comments
Closed

docker-compose #30

hhouissa opened this issue Nov 15, 2019 · 9 comments
Labels

Comments

@hhouissa
Copy link

the playbook fails with below error:
Unable to load docker-compose. Try pip install docker-compose. Error: Traceback (most recent call last):\n File \"/tmp/ansible_docker_service_payload_MtsKkc/ansible_docker_service_payload.zip/ansible/modules/cloud/docker/_docker_service.py

server is new redhat7 and has only what comes from redhat.
all playbooks ran fine except the awx role.
would you please advise?
Thanks,
--Haythem.

@hhouissa
Copy link
Author

hhouissa commented Nov 15, 2019

Information from destination server:
[ansible@rhel7-prod ~]$ docker-compose --version
docker-compose version 1.24.1, build 4667896b
[ansible@rhel7-prod ~]$ sudo su
[root@rhel7-prod ansible]# docker-compose --version
bash: docker-compose: command not found
[root@rhel7-prod ansible]# npm --version
3.10.10
[root@rhel7-prod ansible]# docker --version
Docker version 19.03.5, build 633a0ea
[root@rhel7-prod ansible]# docker-compose --version
bash: docker-compose: command not found
[root@rhel7-prod ansible]# pip --version
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)

How come docker-compose gets installed for the ansible user (same user as in ansible server) but not for the root?

@elcomtik
Copy link

I think I have same issue on my Centos 7(1901) server.

Problem is that python module docker-compose is not installed. I tried to fix that manualy and failed on missing dev python libraries. I fixed that by installing them by yum install python-devel

Then i came into another issue, that python module docker-py is installed, which is in confilct with docker-compose. It is referenced in install manual https://github.com/ansible/awx/blob/devel/INSTALL.md#prerequisites-3

@butler54
Copy link

butler54 commented Dec 20, 2019

I believe there is an issue in the dependency tree somewhere when bringing down docker-compose.

having the following tasks post the suggested awx - per-requisite install seems to fix issues (note how it is forcing the correct version of more-itertools for python 2.7.*)

` tasks:

  • name: uninstall docker-py
    pip:
    name: docker-py
    state: absent
  • name: 'Docker reqs'
    yum:
    name: python-devel
    state: present
  • name: gcc
    yum:
    name: gcc
    state: present
  • name: 'Install docker-compose library'
    pip:
    name: docker-compose
  • name: Force correct version of more-itertools
    pip:
    name: more-itertools
    version: 5.0.0
    state: forcereinstall

@stale
Copy link

stale bot commented Mar 19, 2020

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

@stale stale bot added the stale label Mar 19, 2020
@thursdaddy
Copy link

thursdaddy commented Mar 19, 2020

Hi Guys,

I believe I have run into the same issue and have found a work around. Although I have not tested AWX functionality any further than the initial install and login..

I ran a pre_task to install python3
Update geerlinguy-pip vars:

  pip_package: python3-pip
  pip_executable: pip3
  pip_install_pacakges:
    - name: docker
    - name: docker-compose
    - name: selinux

I added "-e ansible_python_interpreter=/usr/bin/python3" to the "Run the AWX Installation playbook" task in aws-install-playbook.yml (geerlingguy.awx):

ansible-playbook -i inventory install.yml -e postgres_data_dir={{ postgres_data_dir }} -e ansible_python_interpreter=/usr/bin/python3

I have to restart Docker after it completes (not sure why) but after doing so it finishes the migration and I am able to login to the GUI.

@stale
Copy link

stale bot commented Mar 19, 2020

This issue is no longer marked for closure.

@stale stale bot removed the stale label Mar 19, 2020
@chazzly
Copy link

chazzly commented May 22, 2020

@thursdaddy suggestion worked for me. The awx installer assumes python3, so if that's not your default...

@stale
Copy link

stale bot commented Aug 21, 2020

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

@stale stale bot added the stale label Aug 21, 2020
@stale
Copy link

stale bot commented Sep 20, 2020

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

@stale stale bot closed this as completed Sep 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants