実現したいこと・問題点
Andibleでdocker-composeのモジュールが使えるみたいなので使ってみたんですが
エラーが出てしまいました。
発生している問題・エラーメッセージ
fatal: [Client01]: FAILED! => {"changed": false, "msg": "Unable to load docker-compose. Try `pip install docker-compose`. Error: Traceback (most recent call last):\n File \"/tmp/ansible_community.docker.docker_compose_payload_JPoZwx/ansible_community.docker.docker_compose_payload.zip/ansible_collections/community/docker/plugins/modules/docker_compose.py\", line 472, in <module>\nImportError: No module named compose\n"}
該当のソースコード
yml
1--- 2- name: create webserver container 3 community.docker.docker_compose: 4 project_src: webserver
補足情報(環境)
OS:EC2(t2.micro)
$ pip list | egrep "pip|docker|PyYAML" docker 4.4.4 docker-pycreds 0.4.0 pip 9.0.3 PyYAML 5.4.1 $ docker-compose --version docker-compose version 1.7.0, build 0d7bf73 $ curl -vvv http://localhost:2376/version * Trying 127.0.0.1... * TCP_NODELAY set * Connected to localhost (127.0.0.1) port 2376 (#0) > GET /version HTTP/1.1 > Host: localhost:2376 > User-Agent: curl/7.61.1 > Accept: */* > < HTTP/1.1 200 OK < Api-Version: 1.40 < Content-Type: application/json < Docker-Experimental: false < Ostype: linux < Server: Docker/19.03.13-ce (linux) < Date: Fri, 02 Apr 2021 13:14:55 GMT < Content-Length: 860 < {"Platform":{"Name":""},"Components":[{"Name":"Engine","Version":"19.03.13-ce","Details":{"ApiVersion":"1.40","Arch":"amd64","BuildTime":"2020-10-12T18:51:50.000000000+00:00","Experimental":"false","GitCommit":"4484c46","GoVersion":"go1.13.15","KernelVersion":"4.14.225-168.357.amzn2.x86_64","MinAPIVersion":"1.12","Os":"linux"}},{"Name":"containerd","Version":"1.4.4","Details":{"GitCommit":"05f951a3781f4f2c1911b05e61c160e9c30eaa8e"}},{"Name":"runc","Version":"1.0.0-rc93","Details":{"GitCommit":"12644e614e25b05da6fd08a38ffa0cfe1903fdec"}},{"Name":"docker-init","Version":"0.19.0","Details":{"GitCommit":"de40ad0"}}],"Version":"19.03.13-ce","ApiVersion":"1.40","MinAPIVersion":"1.12","GitCommit":"4484c46","GoVersion":"go1.13.15","Os":"linux","Arch":"amd64","KernelVersion":"4.14.225-168.357.amzn2.x86_64","BuildTime":"2020-10-12T18:51:50.000000000+00:00"} * Connection #0 to host localhost left intact
Ansibleの環境は別サーバで構築
$ pip list | egrep "pip|awscli|ansible|docker|boto" ansible 3.2.0 ansible-base 2.10.7 awscli 1.19.43 boto 2.49.0 boto3 1.17.43 botocore 1.20.43 docker-py 1.10.6 docker-pycreds 0.4.0 pip 20.3.4
マニュアルやエラーについて調べましたが独力では解決には至りませんでした。
お力添えのほどよろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/04/02 13:34
2021/04/02 13:45
2021/04/02 14:21
2021/04/02 16:52