Code Monkey home page Code Monkey logo

Comments (15)

nickjj avatar nickjj commented on June 12, 2024 1

Closing this. It's been addressed in v1.8.0 which is available in the Galaxy. The role is back to working with Ansible 2.5 and 2.7.

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

What type of environment are you running this under?

On Ubuntu 16.04, Ubuntu 18.04 and Debian Stretch it installs on a fresh box using version "latest" with state "present".

from ansible-docker.

Platou avatar Platou commented on June 12, 2024

Microsoft Azure : Canonical, UbuntuServer, 18.04-LTS, latest

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

Here's what I used for testing where everything ran successfully:

  • Set up those 3 distros using Docker images
  • Created a stock Ubuntu 18.04 VM using the server ISO on Ubuntu's site
  • Set up a brand new DigitalOcean 18.04 server

In all 3 cases, the role ran to completion and installed the latest version of Docker and Docker Compose.

In all 3 cases, I ran apt-get update -y && apt-get install -y python before this role since that's required for Ansible to run. This is a common bootstrap strategy.

What happens if you add that to a pre_tasks in your playbook?

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

Here's a complete task you can drop in:

- name: Install Python without using Ansible modules
  raw: >
    bash -c "test -e /usr/bin/python \
    || (apt-get -qy update && apt-get install -qy python)"
  changed_when: false

It's using raw since this is meant to be ran before Ansible is even capable of being run.

from ansible-docker.

Platou avatar Platou commented on June 12, 2024

Here's my playbook:

- hosts: "host"
  become: true
  become_method: sudo

  roles:
  - { role: "nickjj.docker", tags: ["docker"] }

  pre_tasks:
  - name: Install python 2
    raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

Does anything change if you use python instead of python-minimal?

from ansible-docker.

Platou avatar Platou commented on June 12, 2024

Same error with python instead of python-minimal

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

You could try adding this after the - name: Install Virtualenv task:

- name: Upgrade PIP
  pip:
    name: "pip"
    virtualenv: "{{ docker__pip_virtualenv }}"
    state: "forcereinstall"

Truthfully I'm not sure why that would be needed on Azure, but it's worth trying.

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

Also what version of Ansible are you using? Maybe the pip package changed in some way to automatically convert latest to being omit. I'm running 2.7.5.

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

Another thing you could try is setting docker__compose_version: "". Let me know if that installs the latest version without erroring out. If it does, that's likely something I should merge into the next release.

from ansible-docker.

Platou avatar Platou commented on June 12, 2024

I'm using Ansible 2.5.1

from ansible-docker.

Platou avatar Platou commented on June 12, 2024

Working fine with Ansible 2.7.5

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

Thanks. Did you happen to try "" with 2.5.1?

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

Going by some PR I read I think "" will fail with 2.5.1 too.

I think any version that's not parseable as a version is getting cast to "" and in 2.5.x, "" gets passed into pip like pip install docker-compose=="" (which is invalid) but with 2.7.x it gets set as pip install docker-compose because Ansible doesn't set the version for empty strings.

I'll leave this issue open until I address a solution that works for both 2.5.x and 2.7.x, thanks for the heads up.

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.