Skip to content

Commit 49b44db

Browse files
committed
Provide detection of RedHat FIPS as a platform
Commit updates the precheck task so that it detects when attempting to deploy on a RedHat FIPS enabled host. Previously precheck returned "el" which resulted in attempts to install non-FIPS PE on a FIPS enabled host, which will fail.
1 parent 4c6d32d commit 49b44db

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: tasks/precheck.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@ if grep -qi ubuntu /etc/os-release; then
77
osfamily="ubuntu"
88
elif grep -qi sles /etc/os-release; then
99
osfamily="sles"
10+
elif grep -qi redhat /etc/os-release && fips-mode-setup --is-enabled; then
11+
osfamily="redhatfips"
1012
else
1113
osfamily="el"
1214
fi
1315

1416
# OS-specific modifications
1517
[ "$osfamily" = "ubuntu" -a "$arch" = "x86_64" ] && arch="amd64"
16-
[ "$osfamily" = "el" ] || [ "$osfamily" = "sles" ] && version=$(echo "$version" | cut -d . -f 1)
18+
[ "$osfamily" = "el" ] || [ "$osfamily" = "sles" ] || [ "$osfamily" = "redhatfips" ] && version=$(echo "$version" | cut -d . -f 1)
1719

1820
# Output a JSON result for ease of Task usage in Puppet Task Plans
1921
cat <<EOS
2022
{
2123
"hostname": "${hostname}",
2224
"platform": "${osfamily}-${version}-${arch}"
2325
}
24-
EOS
26+
EOS

0 commit comments

Comments
 (0)