Skip to content

Commit 56d1f4c

Browse files
committed
fix puppet-lint warnings / switch to facts hash
1 parent 88b7332 commit 56d1f4c

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

manifests/repo/apt.pp

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,29 +55,25 @@
5555
}
5656

5757
# the Gluster repo only supports x86_64 (amd64) and arm64. The Ubuntu PPA also supports armhf and arm64.
58-
case $::operatingsystem {
58+
case $facts['os']['name'] {
5959
'Debian': {
60-
case $::lsbdistcodename {
61-
'jessie', 'stretch': {
62-
$arch = $::architecture ? {
63-
'amd64' => 'amd64',
64-
'arm64' => 'arm64',
65-
default => false,
66-
}
67-
if versioncmp($release, '3.12') < 0 {
68-
$repo_url = "https://download.gluster.org/pub/gluster/glusterfs/${release}/LATEST/Debian/${::lsbdistcodename}/apt/"
69-
} else {
70-
$repo_url = "https://download.gluster.org/pub/gluster/glusterfs/${release}/LATEST/Debian/${::lsbdistcodename}/${arch}/apt/"
71-
}
72-
}
60+
$arch = $facts['architecture'] ? {
61+
'amd64' => 'amd64',
62+
'arm64' => 'arm64',
63+
default => false,
64+
}
65+
if versioncmp($release, '3.12') < 0 {
66+
$repo_url = "https://download.gluster.org/pub/gluster/glusterfs/${release}/LATEST/Debian/${facts['lsbdistcodename']}/apt/"
67+
} else {
68+
$repo_url = "https://download.gluster.org/pub/gluster/glusterfs/${release}/LATEST/Debian/${facts['lsbdistcodename']}/${arch}/apt/"
7369
}
7470
}
7571
default: {
7672
fail('gluster::repo::apt currently only works on Debian')
7773
}
7874
}
7975
if ! $arch {
80-
fail("Architecture ${::architecture} not yet supported for ${::operatingsystem}.")
76+
fail("Architecture ${facts['architecture']} not yet supported for ${facts['operatingsystem']}.")
8177
}
8278

8379
$repo = {

0 commit comments

Comments
 (0)