From 7073ca93b7e1c29d1f4ec610fc09463c7bbd547b Mon Sep 17 00:00:00 2001 From: luksi1 Date: Tue, 8 Mar 2016 12:40:22 +0100 Subject: [PATCH 01/12] Add support for Facter 3 --- manifests/params.pp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 69a73ae..1d9c3c1 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -27,8 +27,13 @@ $minimum_basemodulepath = ['/opt/puppet/share/puppet/modules'] $autosign_conf_path = "${conf_dir}/autosign.conf" + if ($::facterversion > 3) { + $family = $::os[family] + } else { + $family = $::osfamily + } - case $::osfamily { + case $family { Debian:{ # Do nothing } @@ -36,4 +41,5 @@ fail("The NeSI Puppet Puppet module does not support ${::osfamily} family of operating systems") } } -} \ No newline at end of file + +} From 9779ea87aed298a05c723472f016d442ffa0ffb6 Mon Sep 17 00:00:00 2001 From: luksi1 Date: Tue, 8 Mar 2016 12:49:36 +0100 Subject: [PATCH 02/12] Add versioncmp to cast $::facterversion --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 1d9c3c1..73bba4f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -27,7 +27,7 @@ $minimum_basemodulepath = ['/opt/puppet/share/puppet/modules'] $autosign_conf_path = "${conf_dir}/autosign.conf" - if ($::facterversion > 3) { + if (versioncmp($::facterversion) > 3) { $family = $::os[family] } else { $family = $::osfamily From cd67dc653fd7e68c5de8bd28767b98ac1b3528b2 Mon Sep 17 00:00:00 2001 From: luksi1 Date: Tue, 8 Mar 2016 12:51:36 +0100 Subject: [PATCH 03/12] Syntax error with versioncmp --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 73bba4f..1043539 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -27,7 +27,7 @@ $minimum_basemodulepath = ['/opt/puppet/share/puppet/modules'] $autosign_conf_path = "${conf_dir}/autosign.conf" - if (versioncmp($::facterversion) > 3) { + if (versioncmp($::facterversion, 3.0) > 0) { $family = $::os[family] } else { $family = $::osfamily From fcd1dfd4ada12fba7b2057bc0cf2e4b4149590f4 Mon Sep 17 00:00:00 2001 From: luksi1 Date: Tue, 8 Mar 2016 12:52:49 +0100 Subject: [PATCH 04/12] versioncmp needs two strings --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 1043539..a968faa 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -27,7 +27,7 @@ $minimum_basemodulepath = ['/opt/puppet/share/puppet/modules'] $autosign_conf_path = "${conf_dir}/autosign.conf" - if (versioncmp($::facterversion, 3.0) > 0) { + if (versioncmp($::facterversion, "3.0") > 0) { $family = $::os[family] } else { $family = $::osfamily From c3806a7f84380c6ffb6b0aeb9aeeed37c8f496ba Mon Sep 17 00:00:00 2001 From: luksi1 Date: Tue, 8 Mar 2016 12:54:40 +0100 Subject: [PATCH 05/12] notify family --- manifests/params.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifests/params.pp b/manifests/params.pp index a968faa..fe78638 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -33,6 +33,8 @@ $family = $::osfamily } + notify{"This is my family: $family":} + case $family { Debian:{ # Do nothing From b4fe6d30e1f5dc14410d164b669a083419ba3813 Mon Sep 17 00:00:00 2001 From: luksi1 Date: Tue, 8 Mar 2016 12:56:45 +0100 Subject: [PATCH 06/12] Testing family facter variable --- manifests/params.pp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index fe78638..3e47156 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -35,13 +35,13 @@ notify{"This is my family: $family":} - case $family { - Debian:{ - # Do nothing - } - default:{ - fail("The NeSI Puppet Puppet module does not support ${::osfamily} family of operating systems") - } - } + #case $family { + # Debian:{ + # # Do nothing + # } + # default:{ + # fail("The NeSI Puppet Puppet module does not support ${::osfamily} family of operating systems") + # } + #} } From 67b14fb0214bcbd64ebde75b4f548b8f0896c519 Mon Sep 17 00:00:00 2001 From: luksi1 Date: Tue, 8 Mar 2016 12:59:22 +0100 Subject: [PATCH 07/12] Testing family facter variable --- manifests/params.pp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 3e47156..fe78638 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -35,13 +35,13 @@ notify{"This is my family: $family":} - #case $family { - # Debian:{ - # # Do nothing - # } - # default:{ - # fail("The NeSI Puppet Puppet module does not support ${::osfamily} family of operating systems") - # } - #} + case $family { + Debian:{ + # Do nothing + } + default:{ + fail("The NeSI Puppet Puppet module does not support ${::osfamily} family of operating systems") + } + } } From 070e14645dc789ddead6b3f227add44074485bd4 Mon Sep 17 00:00:00 2001 From: luksi1 Date: Tue, 8 Mar 2016 13:00:29 +0100 Subject: [PATCH 08/12] Testing family facter variable --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index fe78638..e718fdc 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -40,7 +40,7 @@ # Do nothing } default:{ - fail("The NeSI Puppet Puppet module does not support ${::osfamily} family of operating systems") + #fail("The NeSI Puppet Puppet module does not support ${::osfamily} family of operating systems") } } From 5304c19e359b5cee4b9f484991d3fa227f9b9afa Mon Sep 17 00:00:00 2001 From: luksi1 Date: Tue, 8 Mar 2016 13:01:31 +0100 Subject: [PATCH 09/12] Testing family facter variable --- manifests/params.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/params.pp b/manifests/params.pp index e718fdc..0926573 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -41,6 +41,7 @@ } default:{ #fail("The NeSI Puppet Puppet module does not support ${::osfamily} family of operating systems") + notify{"What's up":} } } From 599208130775a96084a9b37f1ae50ad56d363679 Mon Sep 17 00:00:00 2001 From: luksi1 Date: Tue, 8 Mar 2016 13:22:11 +0100 Subject: [PATCH 10/12] Support for Facter 3 syntax --- manifests/params.pp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 0926573..fe78638 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -40,8 +40,7 @@ # Do nothing } default:{ - #fail("The NeSI Puppet Puppet module does not support ${::osfamily} family of operating systems") - notify{"What's up":} + fail("The NeSI Puppet Puppet module does not support ${::osfamily} family of operating systems") } } From 4292abb93451212e2ffa02ddb21df09586bd2e16 Mon Sep 17 00:00:00 2001 From: luksi1 Date: Tue, 8 Mar 2016 13:23:27 +0100 Subject: [PATCH 11/12] Support for Facter 3 syntax --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index fe78638..fdc3c97 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -36,7 +36,7 @@ notify{"This is my family: $family":} case $family { - Debian:{ + "Debian":{ # Do nothing } default:{ From a5bda0aa0e4bf3028e39888406659191640a5394 Mon Sep 17 00:00:00 2001 From: Luke Simmons Date: Tue, 8 Mar 2016 21:20:38 +0100 Subject: [PATCH 12/12] case statement values need to have quotes in Puppet 4.2 and Facter 3.1 --- manifests/params.pp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index fdc3c97..1f3dc97 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -27,15 +27,7 @@ $minimum_basemodulepath = ['/opt/puppet/share/puppet/modules'] $autosign_conf_path = "${conf_dir}/autosign.conf" - if (versioncmp($::facterversion, "3.0") > 0) { - $family = $::os[family] - } else { - $family = $::osfamily - } - - notify{"This is my family: $family":} - - case $family { + case $::osfamily { "Debian":{ # Do nothing }