Skip to content

Commit d109a98

Browse files
committed
Add SLES Support
1 parent 06f848e commit d109a98

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

metadata.json

+6
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@
5858
"18.04",
5959
"20.04"
6060
]
61+
},
62+
{
63+
"operatingsystem": "SLES",
64+
"operatingsystemrelease": [
65+
"12"
66+
]
6167
}
6268
],
6369
"requirements": [

tasks/precheck.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
#!/bin/bash
22

33
hostname=$(hostname -f)
4-
osfamily=$(cat /etc/os-release | grep -qi ubuntu && echo "ubuntu" || echo "el")
54
version=$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)
65
arch=$(uname -m)
6+
if grep -qi ubuntu /etc/os-release; then
7+
osfamily="ubuntu"
8+
elif grep -qi sles /etc/os-release; then
9+
osfamily="sles"
10+
else
11+
osfamily="el"
12+
fi
713

814
# OS-specific modifications
915
[ "$osfamily" = "ubuntu" -a "$arch" = "x86_64" ] && arch="amd64"
10-
[ "$osfamily" = "el" ] && version=$(echo "$version" | cut -d . -f 1)
16+
[ "$osfamily" = "el" ] || [ "$osfamily" = "sles" ] && version=$(echo "$version" | cut -d . -f 1)
1117

1218
# Output a JSON result for ease of Task usage in Puppet Task Plans
1319
cat <<EOS

0 commit comments

Comments
 (0)