Code Monkey home page Code Monkey logo

Comments (7)

CristianCantoro avatar CristianCantoro commented on June 12, 2024

Install from the edge branch is successful.

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

Hi,

Couple of issues here.

  1. 18.04 isn't available on stable. That's an edge release. The latest stable release is 18.03.

  2. Docker recently changed their package name styles for 18.04 which broke backwards compatibility with older versions, so to combat that I added a role variable below:

# Full APT package name.
# Note: Docker versions 17.04 to 18.03 do not have that extra ~3 in the middle. 
docker_apt_package_name: "{{ docker_version }}~{{ docker_edition }}~3-0~{{ ansible_distribution | lower }}"

If you want to use a release older than 18.04/edge you would need to remove the ~3 from that variable.

So in your specific case you would want to set:

docker_channel: "stable"
docker_version: "18.03.0"
docker_apt_package_name: "{{ docker_version }}~{{ docker_edition }}-0~{{ ansible_distribution | lower }}"

You can use the role's defaults for everything else.

from ansible-docker.

CristianCantoro avatar CristianCantoro commented on June 12, 2024

Ok, I understand now.

The best thing would be to do as suggested in the Docker documentation:

# apt-cache docker-ce
E: Invalid operation docker-ce
root@ubuntu:~# apt-cache madison docker-ce
 docker-ce | 18.04.0~ce~3-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 18.03.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 18.03.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 18.02.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 18.01.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.12.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.12.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.12.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.12.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.11.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.10.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.09.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.09.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.09.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.09.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.07.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.06.2~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.06.2~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.06.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.06.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.06.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.06.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.05.0~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.04.0~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.03.2~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.03.1~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.03.0~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages

and set docker_apt_package_name accordingly.

In particular, I managed to install version 18.03 of docker-ce from stable with the following:

docker_edition: "ce"
docker_channel: "stable"
docker_version: "18.03.0"
docker_apt_package_name: "{{ docker_version }}~{{ docker_edition }}-0~{{ ansible_distribution | lower }}"

I think the best way to solve this problem is using the command above and then filtering the result to get the right package name, maybe I can make a pull request about this.

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

Right. If you ran that command, parsed it and then compared it to the version supplied for a match, that would be a very welcome PR. Especially if it report helpful errors in the fail cases like "'18.04' is not available in the 'stable' channel".

I just slapped together the variable change for now just so people (myself included) could get 18.04 installed, but in a such a way where 18.03 still worked.

from ansible-docker.

CristianCantoro avatar CristianCantoro commented on June 12, 2024

@nickjj said:

Right. If you ran that command, parsed it and then compared it to the version supplied for a match, that would be a very welcome PR. Especially if it report helpful errors in the fail cases like "'18.04' is not available in the 'stable' channel".

I have opened a PR with a command that gets the package name in a variable, I don't know how to report errors and I could use some guidance about that.

Maybe it would cleaner to have a standalone script, so that error could be managed more easily?

from ansible-docker.

CristianCantoro avatar CristianCantoro commented on June 12, 2024

@nickjj said:

Especially if it report helpful errors in the fail cases like "'18.04' is not available in the 'stable' channel".

Ok, I have added a check.
If the command result is empty, i.e. no package is found, then a message like the following is printed:

TASK [ansible-docker : fail] ******************************************************************************************************************************************************************
fatal: [host]: FAILED! => {"changed": false, "msg": "Docker edition 'ce' version '18.04.0' is not available through the channel 'stable'"}

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

This has been fixed but it's not pushed upstream yet. It will be in the next release.

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.