diff --git a/manifests/init.pp b/manifests/init.pp index bef6f65..210aaab 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) @@ -9,6 +10,7 @@ class { 'tmpreaper::install': enabled => $enabled, packages => $packages, + version => $version, } class { 'tmpreaper::config': 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' }