Skip to content

Commit

Permalink
Removing legacy facts (#70)
Browse files Browse the repository at this point in the history
The modern facts were introduced in Puppet 4.0 and the so-called legacy
facts were deprecated in Puppet 6.0 which was released in 2018. Given
that, this should be a relatively safe change.

Fixes #61
  • Loading branch information
avitacco authored Jan 10, 2025
1 parent 2e47ede commit ccac047
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions manifests/repository.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
anchor { 'graylog::repository::begin': }

if $url == undef {
$graylog_repo_url = $::osfamily ? {
$graylog_repo_url = $facts['os']['family'] ? {
'debian' => 'https://downloads.graylog.org/repo/debian/',
'redhat' => "https://downloads.graylog.org/repo/el/${release}/${version}/\$basearch/",
default => fail("${::osfamily} is not supported!"),
default => fail("${facts['os']['family']} is not supported!"),
}
} else {
$graylog_repo_url = $url
}

case $::osfamily {
case $facts['os']['family'] {
'debian': {
class { 'graylog::repository::apt':
url => $graylog_repo_url,
Expand All @@ -32,7 +32,7 @@
}
}
default: {
fail("${::osfamily} is not supported!")
fail("${facts['os']['family']} is not supported!")
}
}
anchor { 'graylog::repository::end': }
Expand Down
4 changes: 2 additions & 2 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
content => template("${module_name}/server/graylog.conf.erb"),
}

case $::osfamily {
case $facts['os']['family'] {
'debian': {
file { '/etc/default/graylog-server':
ensure => file,
Expand Down Expand Up @@ -80,7 +80,7 @@
}
}
default: {
fail("${::osfamily} is not supported!")
fail("${facts['os']['family']} is not supported!")
}
}

Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 6.21.0 < 8.0.0"
"version_requirement": ">= 6.21.0 < 9.0.0"
}
],
"tags": [
Expand Down

0 comments on commit ccac047

Please sign in to comment.