Giter Site home page Giter Site logo

Comments (10)

sverchdotgov avatar sverchdotgov commented on May 10, 2024 3

Based on https://stackoverflow.com/a/45274492, I found that this resolved the issue (so the installation can install the container-selinux package). The second task was because I'm running on AWS:

- name: Enable RHEL extras repository
  shell: yum-config-manager --enable rhel-7-server-extras-rpms

- name: Enable AWS RHEL extras repository
  shell: yum-config-manager --enable rhui-REGION-rhel-server-extras

@geerlingguy since the build on RHEL doesn't really work without this, do you think that setup would belong in https://github.com/geerlingguy/ansible-role-docker/blob/master/tasks/setup-RedHat.yml?

from ansible-role-docker.

allir avatar allir commented on May 10, 2024 2

This is working in the CentOS tests, so I'm wondering if there's some simpler way of resolving it without enabling an entire extra repo?

Installing docker-ce on RedHat has a dependency to the "container-selinux" package which is not provided in the server-rpms repo, but is in the extras repo.

It's possible to use the "--enablerepo" option in yum to only enable the extras repo for a single command.

yum --enablerepo rhel-7-server-extras-rpms container-selinux

The yum ansible module provides this as well. https://docs.ansible.com/ansible/latest/modules/yum_module.html
Example:

- name: install container-selinux dependency
  yum:
    name: container-selinux
    enablerepo: rhel-7-server-extras-rpms
    state: present
  when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '7'

This would in turn install the package without globally enabling the repo.

Another way would be to install it direcly from rpm via http://mirror.centos.org/centos/7/extras/x86_64/Packages/

from ansible-role-docker.

geerlingguy avatar geerlingguy commented on May 10, 2024 1

AWS is a bit different; they have their own oddities with RHEL-based Amazon Linux (unless you're using a RHEL distro on AWS?

This is working in the CentOS tests, so I'm wondering if there's some simpler way of resolving it without enabling an entire extra repo?

from ansible-role-docker.

otteydw avatar otteydw commented on May 10, 2024

Ran into this same problem today. Had to put in @sverchdotgov 's workaround. But I'd love to see this added into the main repo.

from ansible-role-docker.

grugnog avatar grugnog commented on May 10, 2024

The RHEL official AMIs on AWS use the rhui-REGION-rhel-server-extras style repo names, rather than the rhel-7-server-extras-rpms one (I assume so they can point at a mirror that only responds to AWS requests that have a valid license).

from ansible-role-docker.

webyneter avatar webyneter commented on May 10, 2024

FWIW, these are the extra dependencies I had to install prior to running this role for the latter to succeeed on Amazon Linux 2 (hvm, ebs-backed):

  - name: Install Docker CE CentOS-specific dependencies
    block:
    # region https://docs.docker.com/install/linux/docker-ce/centos/#set-up-the-repository
    - name: Install yum-utils
      package:
        name: yum-utils
        state: present
    - name: Install device-mapper-persistent-data
      package:
        name: device-mapper-persistent-data
        state: present
    - name: Install lvm2
      package:
        name: lvm2
        state: present
    # endregion
    # region https://github.com/docker/for-linux/issues/299#issuecomment-390976518
    - name: yum makecache fast
      shell: yum makecache fast
    - name: Install container-selinux
      shell: yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.42-1.gitad8f0f7.el7.noarch.rpm
    # endregion

from ansible-role-docker.

lanycrost avatar lanycrost commented on May 10, 2024

I think these problem should fix docker...

I have this problem don't only inside RHEL and Amazon Linux. I have this problem in another RPM based operating systems too such as Oracle Linux. I don't understand their version game, but I think he can fix it 😆

docker/for-linux#443

from ansible-role-docker.

stale avatar stale commented on May 10, 2024

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

from ansible-role-docker.

stale avatar stale commented on May 10, 2024

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

from ansible-role-docker.

Fixmetal avatar Fixmetal commented on May 10, 2024

This is still present in RHEL 7.8.

from ansible-role-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.