From 58b511a7ea3c03df783b7aeeb47589d99dc7dc8d Mon Sep 17 00:00:00 2001 From: Jose Plana Date: Fri, 5 Feb 2021 10:22:44 +0100 Subject: [PATCH 1/2] Allow selecting package version --- manifests/init.pp | 1 + manifests/install.pp | 6 ++++-- manifests/params.pp | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index bef6f65..f651cf2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,6 +1,7 @@ class tmpreaper ( $enabled = $tmpreaper::params::enabled, $packages = $tmpreaper::params::packages, + $version = $tmpreaper::params::version, ) inherits tmpreaper::params { validate_bool($enabled) diff --git a/manifests/install.pp b/manifests/install.pp index 962086b..1c1df4b 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -1,9 +1,11 @@ class tmpreaper::install ( $enabled, - $packages + $packages, + $version ) { $_ensure = $enabled ? { - true => present, + true => $version, + false => absent } diff --git a/manifests/params.pp b/manifests/params.pp index 36cc00b..74e01ee 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -14,4 +14,6 @@ fail("Unsupported OS family: ${::osfamily}") } } + + $version = 'present' } From 92144f95efb421640508a4c981187efeeb7d35ef Mon Sep 17 00:00:00 2001 From: Jose Plana Date: Fri, 5 Feb 2021 11:38:17 +0100 Subject: [PATCH 2/2] Add version --- manifests/init.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/init.pp b/manifests/init.pp index f651cf2..210aaab 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -10,6 +10,7 @@ class { 'tmpreaper::install': enabled => $enabled, packages => $packages, + version => $version, } class { 'tmpreaper::config':