From ccac0475642276990d071de79156fa83734004f3 Mon Sep 17 00:00:00 2001 From: Anthony Vitacco <48032399+avitacco@users.noreply.github.com> Date: Fri, 10 Jan 2025 08:41:29 -0500 Subject: [PATCH] Removing legacy facts (#70) 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 --- manifests/repository.pp | 8 ++++---- manifests/server.pp | 4 ++-- metadata.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/manifests/repository.pp b/manifests/repository.pp index 3fb38dd..ddc0f1c 100644 --- a/manifests/repository.pp +++ b/manifests/repository.pp @@ -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, @@ -32,7 +32,7 @@ } } default: { - fail("${::osfamily} is not supported!") + fail("${facts['os']['family']} is not supported!") } } anchor { 'graylog::repository::end': } diff --git a/manifests/server.pp b/manifests/server.pp index e8b0b9a..c4114b1 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -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, @@ -80,7 +80,7 @@ } } default: { - fail("${::osfamily} is not supported!") + fail("${facts['os']['family']} is not supported!") } } diff --git a/metadata.json b/metadata.json index 0b28ef5..cebc201 100644 --- a/metadata.json +++ b/metadata.json @@ -44,7 +44,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 6.21.0 < 8.0.0" + "version_requirement": ">= 6.21.0 < 9.0.0" } ], "tags": [