Skip to content

Commit 12b9017

Browse files
committed
Fix legacy facts
1 parent eb87c9d commit 12b9017

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

examples/sharding.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
}
66
-> class {'mongodb::server':
77
configsvr => true,
8-
bind_ip => [$::ipaddress],
8+
bind_ip => [$facts['networking']['ip']],
99
}
1010
-> class {'mongodb::client': }
1111
-> class {'mongodb::mongos':
12-
configdb => ["${::ipaddress}:27019"],
12+
configdb => ["${facts['networking']['ip']}:27019"],
1313
}
1414
-> mongodb_shard { 'rs1' :
1515
member => 'rs1/mongod1:27018',
@@ -30,7 +30,7 @@
3030
-> class {'mongodb::server':
3131
shardsvr => true,
3232
replset => 'rs1',
33-
bind_ip => [$::ipaddress],
33+
bind_ip => [$facts['networking']['ip']],
3434
}
3535
-> class {'mongodb::client': }
3636
mongodb_replset{'rs1':
@@ -46,7 +46,7 @@
4646
-> class {'mongodb::server':
4747
shardsvr => true,
4848
replset => 'rs1',
49-
bind_ip => [$::ipaddress],
49+
bind_ip => [$facts['networking']['ip']],
5050
}
5151
-> class {'mongodb::client': }
5252
mongodb_replset{'rs1':

manifests/client/params.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
if $manage_package {
77
$package_name = "mongodb-${mongodb::globals::edition}-shell"
88
} else {
9-
$package_name = $::osfamily ? {
9+
$package_name = $facts['os']['family'] ? {
1010
'Debian' => 'mongodb-clients',
1111
default => 'mongodb',
1212
}

manifests/mongos/params.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
$service_status = undef
2828

2929
# Amazon Linux's OS Family is 'Linux', operating system 'Amazon'.
30-
case $::osfamily {
30+
case $facts['os']['family'] {
3131
'RedHat', 'Linux', 'Suse': {
3232
if $manage_package {
3333
$config = '/etc/mongodb-shard.conf'
@@ -53,7 +53,7 @@
5353
$fork = undef
5454
}
5555
default: {
56-
fail("Osfamily ${::osfamily} is not supported")
56+
fail("Osfamily ${facts['os']['family']} is not supported")
5757
}
5858
}
5959
}

manifests/opsmanager.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
String[1] $service_name = 'mongodb-mms',
3333
Stdlib::Httpurl $download_url = 'https://downloads.mongodb.com/on-prem-mms/rpm/mongodb-mms-4.0.1.50101.20180801T1117Z-1.x86_64.rpm',
3434
String[1] $mongo_uri = 'mongodb://127.0.0.1:27017',
35-
Stdlib::Httpurl $opsmanager_url = "http://${facts['fqdn']}:8080",
35+
Stdlib::Httpurl $opsmanager_url = "http://${facts['networking']['fqdn']}:8080",
3636
String[1] $client_certificate_mode = 'None',
3737
String[1] $from_email_addr = '[email protected]',
3838
String[1] $reply_to_email_addr = '[email protected]',

manifests/params.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
}
3939

4040
# Amazon Linux's OS Family is 'Linux', operating system 'Amazon'.
41-
case $::osfamily {
41+
case $facts['os']['family'] {
4242
'RedHat', 'Linux', 'Suse': {
4343
if $manage_package {
4444
$user = pick($mongodb::globals::user, 'mongod')
@@ -79,7 +79,7 @@
7979
$journal = undef
8080
}
8181
default: {
82-
fail("Osfamily ${::osfamily} is not supported")
82+
fail("Osfamily ${facts['os']['family']} is not supported")
8383
}
8484
}
8585
}

manifests/repo.pp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Optional[String] $proxy_password = undef,
1010
Optional[String[1]] $aptkey_options = undef,
1111
) {
12-
case $::osfamily {
12+
case $facts['os']['family'] {
1313
'RedHat', 'Linux': {
1414
if $repo_location != undef {
1515
$location = $repo_location
@@ -45,13 +45,13 @@
4545
}
4646

4747
$mongover = split($version, '[.]')
48-
$location = $::operatingsystem ? {
48+
$location = $facts['os']['name'] ? {
4949
'Debian' => "https://${repo_domain}/apt/debian",
5050
'Ubuntu' => "https://${repo_domain}/apt/ubuntu",
5151
default => undef
5252
}
53-
$release = "${::lsbdistcodename}/${repo_path}/${mongover[0]}.${mongover[1]}"
54-
$repos = $::operatingsystem ? {
53+
$release = "${facts['os']['distro']['codename']}/${repo_path}/${mongover[0]}.${mongover[1]}"
54+
$repos = $facts['os']['name'] ? {
5555
'Debian' => 'main',
5656
'Ubuntu' => 'multiverse',
5757
default => undef
@@ -70,7 +70,7 @@
7070

7171
default: {
7272
if($ensure == 'present' or $ensure == true) {
73-
fail("Unsupported managed repository for osfamily: ${::osfamily}, operatingsystem: ${::operatingsystem}, module ${module_name} currently only supports managing repos for osfamily RedHat, Debian and Ubuntu")
73+
fail("Unsupported managed repository for osfamily: ${facts['os']['family']}, operatingsystem: ${facts['os']['name']}, module ${module_name} currently only supports managing repos for osfamily RedHat, Debian and Ubuntu")
7474
}
7575
}
7676
}

0 commit comments

Comments
 (0)