Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure when adding docker repository #434

Open
pantelis-karamolegkos opened this issue Nov 13, 2023 · 6 comments
Open

Failure when adding docker repository #434

pantelis-karamolegkos opened this issue Nov 13, 2023 · 6 comments

Comments

@pantelis-karamolegkos
Copy link

I am installing the role as follows

    - name: Install required ansible-galaxy roles
      local_action: shell ansible-galaxy install -r requirements.yaml --force

where

$ cat requirements.yaml
- src: geerlingguy.docker

and then invoking it

    - name: Install docker and docker-compose
      include_role:
        name: geerlingguy.docker
        apply:
          become: yes
      vars:
        docker_compose_path: "/usr/local/bin/docker-compose"
        docker_compose_version: "1.27.4"

This fails with the following error

│ TASK [geerlingguy.docker : Add Docker repository.]
│ *****************************
│ An exception occurred during task execution. To see the full traceback, use
│ -vvv. The error was: apt_pkg.Error: E:Conflicting values set for option
│ Signed-By regarding source https://download.docker.com/linux/ubuntu/ focal:
│ /etc/apt/trusted.gpg.d/docker.asc != , E:The list of sources could not be
│ read.

ansible runs on the following machine

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.2 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.2 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Any suggestions?

@pantelis-karamolegkos
Copy link
Author

@geerlingguy does it have to do maybe with this commit? was the initial name of the list file download_docker_com_linux_ubuntu.list

@kawadeomkar
Copy link

Hey @pantelis-karamolegkos I had the same issue and fixed it here #436
do you mind trying it out to see if it works for you?
You first need to run

sudo rm /etc/apt/sources.list.d/docker.list
sudo rm /etc/apt/sources.list.d/download_docker_com_linux_ubuntu.list

in the respective environment

@pantelis-karamolegkos
Copy link
Author

@kawadeomkar yes I tried that and it did solve the issue; I believe the problem relates to what I said in my last comment, i.e. to the renaming of the source file (although not 100% sure)

@kawadeomkar
Copy link

@pantelis-karamolegkos Yes I believe so as well. Not entirely sure but with the commit you mentioned, this addition:

docker_apt_filename: "docker"

I think may have caused the inconsistency with the Signed-by field. Previously it was named download_docker_com_linux_ubuntu but it is named docker now - so if you had run a previous version of this role you
would get this error.

@nerg4l
Copy link

nerg4l commented Feb 19, 2024

Is there a plan to make it backwards compatible or to pin this issue? All I had to do was remove those files but I use Ansible to avoid touching my servers.

@quiqueg
Copy link

quiqueg commented Mar 23, 2024

Looks like the change was intentional, and some notes were added to the README.md here (emphasis mine):

docker_apt_filename controls the name of the source list file created in sources.list.d. If you are upgrading from an older (<7.0.0) version of this role, you should change this to the name of the existing file (e.g. download_docker_com_linux_debian on Debian) to avoid conflicting lists.

I read through the whole diff before upgrading, yet still missed this :)

Perhaps a CHANGELOG.md or some other lightweight Migrating from v# in the README.md would help users to catch these types of issues before upgrading?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants