Giter VIP home page Giter VIP logo

Comments (10)

nickjj avatar nickjj commented on July 4, 2024 1

The Create and start services on Docker-compose task isn't a part of this role.

How are you starting Docker Compose in that task?

Have you checked the README about using the docker_* modules? https://github.com/nickjj/ansible-docker#working-with-ansibles-docker_-modules

Do you get the same error if you run docker-compose up on your server directly?

from ansible-docker.

nickjj avatar nickjj commented on July 4, 2024

Hi,

What version of Python do you have installed?

from ansible-docker.

SaymonDzen avatar SaymonDzen commented on July 4, 2024

HI
ansible_python_interpreter=/usr/bin/python3
ls -la /usr/bin/python3
lrwxrwxrwx 1 root root 9 Mar 13 2020 /usr/bin/python3 -> python3.8

from ansible-docker.

SaymonDzen avatar SaymonDzen commented on July 4, 2024
    - name: Create and start services on Docker-compose
      community.docker.docker_compose:
        project_src: "/opt/erlymon/"

if you run directly, then no errors are displayed

docker-compose -v
docker-compose version 1.29.2, build unknown

docker-compose -f /opt/erlymon/docker-compose.yml up
Creating network "erlymon_default" with the default driver
Creating volume "erlymon_prometheus_data" with default driver
Creating volume "erlymon_grafana_data" with default driver
Pulling prometheus (prom/prometheus:latest)...
...

from ansible-docker.

nickjj avatar nickjj commented on July 4, 2024

Check the readme link I supplied.

from ansible-docker.

SaymonDzen avatar SaymonDzen commented on July 4, 2024

I added vars ansible_python_interpreter in task, nothing has changed

    - name: Create and start services on Docker-compose
      community.docker.docker_compose:
        project_src: "/opt/erlymon/"
      vars:
        ansible_python_interpreter: "/usr/bin/env python3-docker"

from ansible-docker.

SaymonDzen avatar SaymonDzen commented on July 4, 2024

I was wrong, that's another task! Thank you very much for your help and patience.

from ansible-docker.

nickjj avatar nickjj commented on July 4, 2024

No problem, I'm guessing it's all working now?

from ansible-docker.

SaymonDzen avatar SaymonDzen commented on July 4, 2024

Yes, everything works with this. Thank you! Now installing the role on a clean host (exactly the role - task from examply) I encountered apt problem.

TASK [nickjj.docker : Install Docker's dependencies] ***************************
fatal: [monitoring-stage.e]: FAILED! => {"cache_update_time": 1622726890, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"      install 'apt-transport-https' 'gnupg2' 'software-properties-common' 'gcc' 'python3-dev' 'python3-pip' 'virtualenv'' failed: E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem. \n", "rc": 100, "stderr": "E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem. \n", "stderr_lines": ["E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem. "], "stdout": "", "stdout_lines": []}

dpkg --configure -a on host resolved this promblem. This is probably a problem with the ubuntu repositories. A couple of hours ago, from that virtual machine template with cloudinit, I did not observe this problem

from ansible-docker.

nickjj avatar nickjj commented on July 4, 2024

Typically a fresh host would have sudo apt-get update run on it before preparing it to run Ansible, perhaps through a dedicated bootstrap role.

That's why this role doesn't run the update itself. IMO this is an anti-pattern of Ansible roles to run an apt update in every role, or define a cache timeout, it's something I used to do 5 years ago but stopped.

from ansible-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.