-
Notifications
You must be signed in to change notification settings - Fork 1.9k
docker_service Unable to load docker-compose. #5522
Comments
@ansible ping, this issue is waiting for your response. |
Any luck on this in the meantime? Workaround probably? |
Found a workaround in the meantime on my mac. Ansible uses a different Python version than macOS does. Running |
tried the docker install on the OS X machine, no change. I was using the word "host" wrong in my description (changed now) |
Ah, clear. Did you ensure docker is running and available in the box? What versions of |
yes - if I ssh to the virtual box and run docker-compose on the yml file that ansible copied over to that box, the containers spin up fine.
|
Got same error:
Docker installed on OS X by Docker Tollbox:
Ansbile:
deploy.yml:
|
@ansible, ping. This issue is still waiting on your response. |
Problem was in that there wasn't pip and mandatory libs installed on target server. Resolved by adding appropriate instructions into playbook. |
@coodix What were the libs that you had to install on the target server in order for it to work? They're not mentionned in the documentation at https://docs.ansible.com/ansible/docker_service_module.html |
@psionikangel , actually requirements are described on that page below the "Requirements (on host that executes module)" header. My working playbook is:
The idea is that python, pip and docker_compose package should be installed on target machine. |
This was strange. I had all the requirements already installed on the target server. The only difference is I had installed them through apt instead of pip. Installing them with pip fixed the issue. |
yep - this is definitely a problem with docker components installed using apt instead of pip. Installing via pip in ansible or via pip on the host works. |
This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible Please read through the repomerge page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo. |
Just for information, you can also have another See upstream issue on docker/compose#5156 |
I can also repro this with the latest docker-compose and pip, the same playbook was running fine three days ago. docker-compose 1.15.0 works for me with ansible 2.4.0 while docker-compose 1.16.1 fails with the same version of ansible. |
Same error here: fatal: [******]: FAILED! => {"changed": false, "failed": true, "msg": "Unable to load docker-compose. Try |
+1 ansible --version docker-compose --version: |
+1
on remote host
|
Those of you saying +1: Your comments are a hassle and completely unnecessary, please stop doing that anywhere. Now, on the issue at hand, it seems like the official resolution from the docker-compose team will be to say that there's no API guarantee for those trying to use compose as a library. Maybe the ansible modules should issue system commands to communicate with docker-compose instead of trying to use it as a library, to avoid these kind of problems in the future. |
This issue was migrated to ansible/ansible#29510 |
For the folks getting the splitdrive error, that's really ansible/ansible#29498, not this bug. For those users, Ansible 2.3.x and Docker Compose 1.16.x don't get along. Either move up to 2.4rc's or limit yourself to Docker Compose <1.16. |
The symptoms are the same as 3906, which is closed as resolved.
ISSUE TYPE
COMPONENT NAME
docker_service
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
OS-X 10.11.16 (executing playbook here)
host, running on virtualbox:
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
SUMMARY
"Unable to load docker-compose. Try
pip install docker-compose
. Error: cannot import name build_action_from_opts"The results seems to be the same as 3906, which I believe is included in the 2.2.0 release.
STEPS TO REPRODUCE
added docker_service section to playbook, ran playbook on OS-X, host is Ubuntu 16.04
EXPECTED RESULTS
PLAY [local-services] **********************************************************
TASK [setup] *******************************************************************
ok: [192.168.67.25]
TASK [copy compose file to remote server] **************************************
ok: [192.168.67.25]
TASK [docker-compose via ansible docker_service] *********************
ok: [192.168.67.25]
PLAY RECAP *********************************************************************
192.168.67.25 : ok=3 changed=0 unreachable=0 failed=0
ACTUAL RESULTS
partial result (failed task only)
The text was updated successfully, but these errors were encountered: