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

fix redhat distribution not supported #255

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tasks/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def install_ssh_components(distro, version, container)
run_local_command("docker exec #{container} dnf clean all")
run_local_command("docker exec #{container} dnf install -y sudo openssh-server openssh-clients")
run_local_command("docker exec #{container} ssh-keygen -A")
when %r{centos}, %r{^el-}, %r{eos}, %r{oracle}, %r{ol}, %r{redhat}, %r{scientific}, %r{amzn}, %r{rocky}, %r{almalinux}
when %r{centos}, %r{^el-}, %r{eos}, %r{oracle}, %r{ol}, %r{rhel|redhat}, %r{scientific}, %r{amzn}, %r{rocky}, %r{almalinux}
if version == '6'
# sometimes the redhat 6 variant containers like to eat their rpmdb, leading to
# issues with "rpmdb: unable to join the environment" errors
Expand Down Expand Up @@ -68,11 +68,12 @@ def fix_ssh(distro, version, container)
case distro
when %r{debian}, %r{ubuntu}
run_local_command("docker exec #{container} service ssh restart")
when %r{centos}, %r{^el-}, %r{eos}, %r{fedora}, %r{ol}, %r{redhat}, %r{scientific}, %r{amzn}, %r{rocky}, %r{almalinux}
when %r{centos}, %r{^el-}, %r{eos}, %r{fedora}, %r{ol}, %r{rhel|redhat}, %r{scientific}, %r{amzn}, %r{rocky}, %r{almalinux}
# Current RedHat/CentOs 7 packs an old version of pam, which are missing a
# crucial patch when running unprivileged containers. See:
# https://bugzilla.redhat.com/show_bug.cgi?id=1728777
run_local_command("docker exec #{container} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd") if distro =~ %r{redhat|centos} && version =~ %r{^7}
run_local_command("docker exec #{container} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd") \
if distro =~ %r{rhel|redhat|centos} && version =~ %r{^7}

if %r{^(7|8|9|2)}.match?(version)
run_local_command("docker exec #{container} /usr/sbin/sshd")
Expand Down
Loading