Comments (10)
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.
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.
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.
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.
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.
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.
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 😆
from ansible-role-docker.
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.
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.
This is still present in RHEL 7.8.
from ansible-role-docker.
Related Issues (20)
- Debian: add `signed-by` param to the apt list HOT 3
- Setting hosts in docker_daemon_opts variable on a debian 11 host breaks docker HOT 8
- Option to install rootless HOT 4
- Molecule support in GitLab CI HOT 3
- Unable to install a specific version of docker on ubuntu HOT 6
- Run playbook HOT 1
- Idempotence test failed HOT 3
- feature: use ansible facts HOT 3
- Amazon Linux 2023 support HOT 1
- docker-compose-plugin install fails on arch HOT 6
- geerlingguy.docker was NOT installed successfully HOT 4
- error in first run during check if there are any users to add to docker group HOT 2
- Failure when adding docker repository HOT 6
- GPG keys should not be saved to `/apt/trusted.gpg.d` / Do not use `apt-key` HOT 1
- Playbook Fails with error when uninstalling HOT 1
- Reload system config at start
- ansible.builtin.include has been removed Error while installing docker role HOT 1
- no /etc/docker/daemon.json ? HOT 1
- Fix min_ansible_version type
- Update docker version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-role-docker.