Skip to content

Commit 02fd75b

Browse files
committed
fix redhat distribution not supported
1 parent ba09357 commit 02fd75b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tasks/docker.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def install_ssh_components(distro, version, container)
1818
run_local_command("docker exec #{container} dnf clean all")
1919
run_local_command("docker exec #{container} dnf install -y sudo openssh-server openssh-clients")
2020
run_local_command("docker exec #{container} ssh-keygen -A")
21-
when %r{centos}, %r{^el-}, %r{eos}, %r{oracle}, %r{ol}, %r{redhat}, %r{scientific}, %r{amzn}, %r{rocky}, %r{almalinux}
21+
when %r{centos}, %r{^el-}, %r{eos}, %r{oracle}, %r{ol}, %r{rhel|redhat}, %r{scientific}, %r{amzn}, %r{rocky}, %r{almalinux}
2222
if version == '6'
2323
# sometimes the redhat 6 variant containers like to eat their rpmdb, leading to
2424
# issues with "rpmdb: unable to join the environment" errors
@@ -68,11 +68,11 @@ def fix_ssh(distro, version, container)
6868
case distro
6969
when %r{debian}, %r{ubuntu}
7070
run_local_command("docker exec #{container} service ssh restart")
71-
when %r{centos}, %r{^el-}, %r{eos}, %r{fedora}, %r{ol}, %r{redhat}, %r{scientific}, %r{amzn}, %r{rocky}, %r{almalinux}
71+
when %r{centos}, %r{^el-}, %r{eos}, %r{fedora}, %r{ol}, %r{rhel|redhat}, %r{scientific}, %r{amzn}, %r{rocky}, %r{almalinux}
7272
# Current RedHat/CentOs 7 packs an old version of pam, which are missing a
7373
# crucial patch when running unprivileged containers. See:
7474
# https://bugzilla.redhat.com/show_bug.cgi?id=1728777
75-
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}
75+
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}
7676

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

0 commit comments

Comments
 (0)