Skip to content

Commit 3fbe0d6

Browse files
committed
Fix legacy facts
1 parent 9c881c9 commit 3fbe0d6

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868

6969
if $use_exported_resources {
7070
# first we export this server's instance
71-
@@gluster::peer { $::fqdn:
71+
@@gluster::peer { $facts['networking']['fqdn']:
7272
pool => $pool,
7373
}
7474

manifests/params.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818
# Set distro/release specific names, repo versions, repo gpg keys, package versions, etc
1919
# if the user didn't specify a version, just use "installed" for package version.
2020
# if they did specify a version, assume they provided a valid one
21-
case $::osfamily {
21+
case $facts['os']['family'] {
2222
'RedHat': {
2323
$repo = true
2424
$repo_gpg_key_source = 'https://raw.githubusercontent.com/CentOS-Storage-SIG/centos-release-storage-common/master/RPM-GPG-KEY-CentOS-SIG-Storage'
2525

26-
$server_package = $::operatingsystemmajrelease ? {
26+
$server_package = $facts['os']['release']['major'] ? {
2727
# RHEL 6 and 7 provide Gluster packages natively
2828
/(6|7)/ => 'glusterfs-server',
2929
default => false
3030
}
31-
$client_package = $::operatingsystemmajrelease ? {
31+
$client_package = $facts['os']['release']['major'] ? {
3232
/(6|7)/ => 'glusterfs-fuse',
3333
default => false,
3434
}

manifests/peer.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#
3737
define gluster::peer (
3838
$pool = 'default',
39-
$fqdn = $::fqdn,
39+
$fqdn = $facts['networking']['fqdn'],
4040
) {
4141

4242
# we can't do much without the Gluster binary
@@ -45,7 +45,7 @@
4545
if getvar('::gluster_binary') {
4646
# we can't join to ourselves, so it only makes sense to operate
4747
# on other gluster servers in the same pool
48-
if $fqdn != $::fqdn {
48+
if $fqdn != $facts['networking']['fqdn'] {
4949

5050
# and we don't want to attach a server that is already a member
5151
# of the current pool

manifests/repo.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
$release = $gluster::params::release,
2020
$version = $gluster::params::version,
2121
) inherits gluster::params {
22-
case $::osfamily {
22+
case $facts['os']['family'] {
2323
'RedHat': {
2424
class { 'gluster::repo::yum':
2525
release => $release,
@@ -30,6 +30,6 @@
3030
version => $version,
3131
}
3232
}
33-
default: { fail("${::osfamily} not yet supported!") }
33+
default: { fail("${facts['os']['family']} not yet supported!") }
3434
}
3535
}

manifests/repo/apt.pp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,23 @@
5151
} elsif $version =~ /^(\d)\.(\d+)\.(\d+).*$/ {
5252
$repo_ver = "${1}.${2}/${1}.${2}.${3}"
5353
} else {
54-
fail("${version} doesn't make sense for ${::operatingsystem}!")
54+
fail("${version} doesn't make sense for ${facts['os']['name']}!")
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 {
60+
case $facts['os']['distro']['codename'] {
6161
'jessie', 'stretch': {
62-
$arch = $::architecture ? {
62+
$arch = $facts['os']['architecture'] ? {
6363
'amd64' => 'amd64',
6464
'arm64' => 'arm64',
6565
default => false,
6666
}
6767
if versioncmp($release, '3.12') < 0 {
68-
$repo_url = "https://download.gluster.org/pub/gluster/glusterfs/${release}/LATEST/Debian/${::lsbdistcodename}/apt/"
68+
$repo_url = "https://download.gluster.org/pub/gluster/glusterfs/${release}/LATEST/Debian/${facts['os']['distro']['codename']}/apt/"
6969
} else {
70-
$repo_url = "https://download.gluster.org/pub/gluster/glusterfs/${release}/LATEST/Debian/${::lsbdistcodename}/${arch}/apt/"
70+
$repo_url = "https://download.gluster.org/pub/gluster/glusterfs/${release}/LATEST/Debian/${facts['os']['distro']['codename']}/${arch}/apt/"
7171
}
7272
}
7373
}
@@ -77,14 +77,14 @@
7777
}
7878
}
7979
if ! $arch {
80-
fail("Architecture ${::architecture} not yet supported for ${::operatingsystem}.")
80+
fail("Architecture ${facts['os']['architecture']} not yet supported for ${facts['os']['name']}.")
8181
}
8282

8383
$repo = {
8484
"glusterfs-${version}" => {
8585
ensure => present,
8686
location => $repo_url,
87-
release => $::lsbdistcodename,
87+
release => $facts['os']['distro']['codename'],
8888
repos => 'main',
8989
key => {
9090
id => $repo_key_name,

manifests/repo/yum.pp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,28 @@
2121
) inherits gluster::params {
2222

2323
# CentOS Gluster repo only supports x86_64
24-
if $::architecture != 'x86_64' {
25-
fail("Architecture ${::architecture} not yet supported for ${::operatingsystem}.")
24+
if $facts['os']['architecture'] != 'x86_64' {
25+
fail("Architecture ${facts['os']['architecture']} not yet supported for ${facts['os']['name']}.")
2626
}
2727

2828
if $priority {
2929
if ! defined( Package['yum-plugin-priorities'] ) {
3030
package { 'yum-plugin-priorities':
3131
ensure => installed,
32-
before => Yumrepo["glusterfs-${::architecture}"],
32+
before => Yumrepo["glusterfs-${facts['os']['architecture']}"],
3333
}
3434
}
3535
}
3636

37-
yumrepo { "glusterfs-${::architecture}":
37+
yumrepo { "glusterfs-${facts['os']['architecture']}":
3838
enabled => 1,
39-
baseurl => "http://mirror.centos.org/centos/${::operatingsystemmajrelease}/storage/${::architecture}/gluster-${release}/",
40-
descr => "CentOS-${::operatingsystemmajrelease} - Gluster ${release}",
39+
baseurl => "http://mirror.centos.org/centos/${facts['os']['release']['major']}/storage/${facts['os']['architecture']}/gluster-${release}/",
40+
descr => "CentOS-${facts['os']['release']['major']} - Gluster ${release}",
4141
gpgcheck => 1,
4242
gpgkey => $repo_key_source,
4343
priority => $priority,
4444
}
4545

46-
Yumrepo["glusterfs-${::architecture}"] -> Package<| tag == 'gluster-packages' |>
46+
Yumrepo["glusterfs-${facts['os']['architecture']}"] -> Package<| tag == 'gluster-packages' |>
4747

4848
}

0 commit comments

Comments
 (0)