Skip to content

Commit 68a140b

Browse files
authored
Merge pull request #355 from smortex/legacy-facts-usage
Fix legacy fact usage
2 parents bbe0dac + 6e1c683 commit 68a140b

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

manifests/globals.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
$database = 'postgres',
55
) {
66

7-
if !($::osfamily in ['RedHat', 'Suse', 'Archlinux', 'Debian', 'OpenBSD', 'FreeBSD']) {
8-
fail("${module_name} does not support your osfamily ${::osfamily}")
7+
if !(fact('os.family') in ['RedHat', 'Suse', 'Archlinux', 'Debian', 'OpenBSD', 'FreeBSD']) {
8+
fail("${module_name} does not support your osfamily ${fact('os.family')}")
99
}
1010

1111
}

manifests/master/config.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Manage puppet configuration. See README.md for more details.
22
class puppetdb::master::config (
3-
$puppetdb_server = $::fqdn,
3+
$puppetdb_server = fact('networking.fqdn'),
44
$puppetdb_port = defined(Class['puppetdb']) ? {
55
true => $::puppetdb::disable_ssl ? {
66
true => 8080,

manifests/params.pp

+8-8
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
$manage_dbserver = true
2020
$manage_database = true
2121

22-
if $::osfamily =~ /RedHat|Debian/ {
22+
if fact('os.family') =~ /RedHat|Debian/ {
2323
$manage_pg_repo = true
2424
} else {
2525
$manage_pg_repo = false
@@ -41,7 +41,7 @@
4141
$jdbc_ssl_properties = ''
4242
$database_validate = true
4343
$database_max_pool_size = undef
44-
$puppetdb_server = $::fqdn
44+
$puppetdb_server = fact('networking.fqdn')
4545

4646
# These settings manage the various auto-deactivation and auto-purge settings
4747
$node_ttl = '7d'
@@ -86,7 +86,7 @@
8686
$masterless = false
8787

8888
if !($puppetdb_version in ['latest','present','absent']) and versioncmp($puppetdb_version, '3.0.0') < 0 {
89-
case $::osfamily {
89+
case fact('os.family') {
9090
'RedHat', 'Suse', 'Archlinux','Debian': {
9191
$etcdir = '/etc/puppetdb'
9292
$vardir = '/var/lib/puppetdb'
@@ -109,13 +109,13 @@
109109
$puppet_service_name = 'puppetmaster'
110110
}
111111
default: {
112-
fail("The fact 'osfamily' is set to ${::osfamily} which is not supported by the puppetdb module.")
112+
fail("The fact 'os.family' is set to ${fact('os.family')} which is not supported by the puppetdb module.")
113113
}
114114
}
115115
$terminus_package = 'puppetdb-terminus'
116116
$test_url = '/v3/version'
117117
} else {
118-
case $::osfamily {
118+
case fact('os.family') {
119119
'RedHat', 'Suse', 'Archlinux','Debian': {
120120
$etcdir = '/etc/puppetlabs/puppetdb'
121121
$puppet_confdir = pick($settings::confdir,'/etc/puppetlabs/puppet')
@@ -132,7 +132,7 @@
132132
$puppet_service_name = undef
133133
}
134134
default: {
135-
fail("The fact 'osfamily' is set to ${::osfamily} which is not supported by the puppetdb module.")
135+
fail("The fact 'os.family' is set to ${fact('os.family')} which is not supported by the puppetdb module.")
136136
}
137137
}
138138
$terminus_package = 'puppetdb-termini'
@@ -144,7 +144,7 @@
144144
$confdir = "${etcdir}/conf.d"
145145
$ssl_dir = "${etcdir}/ssl"
146146

147-
case $::osfamily {
147+
case fact('os.family') {
148148
'RedHat', 'Suse', 'Archlinux': {
149149
$puppetdb_user = 'puppetdb'
150150
$puppetdb_group = 'puppetdb'
@@ -166,7 +166,7 @@
166166
$puppetdb_initconf = undef
167167
}
168168
default: {
169-
fail("The fact 'osfamily' is set to ${::osfamily} which is not supported by the puppetdb module.")
169+
fail("The fact 'os.family' is set to ${fact('os.family')} which is not supported by the puppetdb module.")
170170
}
171171
}
172172

0 commit comments

Comments
 (0)