haxorof/ansible-role-docker-ce

RHEL8 requires --allowerasing for yum install to work

moonlight16 opened this issue · 3 comments

Version Information

❯ ansible --version
ansible [core 2.13.1]
  config file = None
  configured module search path = ['/Users/me/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/6.1.0/libexec/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/me/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.5 (main, Jun 23 2022, 17:15:25) [Clang 13.1.6 (clang-1316.0.21.2.5)]
  jinja version = 3.1.2
  libyaml = True

My hosts are running:

# cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.6 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.6"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.6 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/8/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.6
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.6"

Steps to Reproduce

I'm running the simple playbook from the README.

Expected Behavior

Playbook ran successfully.

Actual Behavior

It hangs here:

TASK [docker-ce : Ensure Docker CE is installed] *******************************************************************************************************************************************
ok: [dataorch1-worker-1] => (item=docker-ce-cli) => {"ansible_loop_var": "item", "attempts": 1, "changed": false, "item": "docker-ce-cli", "msg": "Nothing to do", "rc": 0, "results": []}
ok: [dataorch1-worker-2] => (item=docker-ce-cli) => {"ansible_loop_var": "item", "attempts": 1, "changed": false, "item": "docker-ce-cli", "msg": "Nothing to do", "rc": 0, "results": []}
ok: [dataorch1-master] => (item=docker-ce-cli) => {"ansible_loop_var": "item", "attempts": 1, "changed": false, "item": "docker-ce-cli", "msg": "Nothing to do", "rc": 0, "results": []}
FAILED - RETRYING: [dataorch1-worker-1]: Ensure Docker CE is installed (6 retries left).
FAILED - RETRYING: [dataorch1-worker-2]: Ensure Docker CE is installed (6 retries left).
FAILED - RETRYING: [dataorch1-master]: Ensure Docker CE is installed (6 retries left).
FAILED - RETRYING: [dataorch1-worker]: Ensure Docker CE is installed (5 retries left).
FAILED - RETRYING: [dataorch1-worker]: Ensure Docker CE is installed (5 retries left).
FAILED - RETRYING: [dataorch1-master]: Ensure Docker CE is installed (5 retries left).
FAILED - RETRYING: [dataorch1-worker]: Ensure Docker CE is installed (4 retries left).
FAILED - RETRYING: [dataorch1-worker]: Ensure Docker CE is installed (4 retries left).
FAILED - RETRYING: [dataorch1-master]: Ensure Docker CE is installed (4 retries left).

I run the command directly on the host:

# yum install  docker-ce docker-ce-cli containerd.io
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)                                                                      59 kB/s | 2.8 kB     00:00
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)                                                                         50 kB/s | 2.4 kB     00:00
Package docker-ce-cli-1:20.10.17-3.el8.x86_64 is already installed.
Error:
 Problem 1: problem with installed package podman-2:4.1.1-2.module+el8.6.0+15917+093ca6f8.x86_64
  - package podman-2:4.1.1-2.module+el8.6.0+15917+093ca6f8.x86_64 requires runc >= 1.0.0-57, but none of the providers can be installed
  - package podman-1.0.0-2.git921f98f.module+el8.0.0+2958+4e823551.x86_64 requires runc, but none of the providers can be installed

<lots of output>

  - package runc-1:1.0.3-1.module+el8.6.0+14672+b2f82327.x86_64 is filtered out by modular filtering
  - package runc-1.0.0-73.rc95.module+el8.6.0+14874+64436299.x86_64 is filtered out by modular filtering
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

If I add --allowerasing to the yum command then it will successfully install these packages.

Since we're using the generic package command in the task, I don't see an easy way to resolve. Even if we used the yum command, it doesn't support adding options. It does support skip_broken, but I tried this and it doesn't work.

References

Hi @moonlight16!
If I understand you correctly you are having a RHEL 8 machine with Podman already installed on, correct? Then you now want to install Docker CE using my role?

Cheers!

I have a similar effect, however, it's a Rocky Linux 9 VM ...

$ ansible --version
ansible 2.9.6
  config file = /...directory.../plays/ansible.cfg
  configured module search path = ['/home/michael/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]

Ansible playbook:

- hosts: all
  vars:
    docker_sdk: true
    docker_compose: true
  roles:
    - haxorof.docker_ce

Output:

TASK [haxorof.docker_ce : Ensure Docker CE is installed] *********************************************************************************************
FAILED - RETRYING: Ensure Docker CE is installed (6 retries left).
FAILED - RETRYING: Ensure Docker CE is installed (5 retries left).
FAILED - RETRYING: Ensure Docker CE is installed (4 retries left).
FAILED - RETRYING: Ensure Docker CE is installed (3 retries left).
FAILED - RETRYING: Ensure Docker CE is installed (2 retries left).
FAILED - RETRYING: Ensure Docker CE is installed (1 retries left).
failed: [x14] (item=docker-ce-cli) => {"ansible_loop_var": "item", "attempts": 6, "changed": false, "item": "docker-ce-cli", "msg": "Failed to download packages: docker-ce-cli-1:20.10.20-3.el9.x86_64: Already downloaded", "results": []}
FAILED - RETRYING: Ensure Docker CE is installed (6 retries left).
FAILED - RETRYING: Ensure Docker CE is installed (5 retries left).
FAILED - RETRYING: Ensure Docker CE is installed (4 retries left).
FAILED - RETRYING: Ensure Docker CE is installed (3 retries left).
FAILED - RETRYING: Ensure Docker CE is installed (2 retries left).
FAILED - RETRYING: Ensure Docker CE is installed (1 retries left).
failed: [x14] (item=docker-ce) => {"ansible_loop_var": "item", "attempts": 6, "changed": false, "item": "docker-ce", "msg": "Failed to download packages: docker-ce-3:20.10.20-3.el9.x86_64: Already downloaded", "results": []}
ok: [x14] => (item=containerd.io)

Can you please run this command to see if you have installed podman in your system?

sudo dnf list --installed | grep podman