summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorb4ldr <github@johnbond.org>2016-02-22 12:52:07 +0000
committerb4ldr <github@johnbond.org>2016-03-31 15:37:53 -0300
commit3a4abe4f98d4c24989a1def59968cb49d1d26268 (patch)
tree6908974fb30b0b99c8d70c1939511f489d43033e /manifests
parent1ddfcea4c298cbe6236622020ec440e5e0633341 (diff)
add options support
fix ruby 1.9 hash correct
Diffstat (limited to 'manifests')
-rw-r--r--manifests/init.pp13
-rw-r--r--manifests/params.pp5
2 files changed, 17 insertions, 1 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 489db32..7b09d0a 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -18,6 +18,7 @@ class unattended_upgrades (
$upgradeable_packages = {},
$verbose = 0,
$notify_update = false,
+ $options = {},
) inherits ::unattended_upgrades::params {
if $legacy_origin == undef or $origins == undef {
@@ -45,6 +46,12 @@ class unattended_upgrades (
validate_integer($size)
validate_hash($upgradeable_packages)
$_upgradeable_packages = merge($::unattended_upgrades::default_upgradeable_packages, $upgradeable_packages)
+ validate_hash($options)
+ $_options = merge($unattended_upgrades::default_options, $options)
+ validate_bool($_options['force_confdef'])
+ validate_bool($_options['force_confold'])
+ validate_bool($_options['force_confnew'])
+ validate_bool($_options['force_confmiss'])
package { 'unattended-upgrades':
ensure => $package_ensure,
@@ -70,5 +77,11 @@ class unattended_upgrades (
require => Package['unattended-upgrades'],
notify_update => $notify_update,
}
+ apt::conf { 'options':
+ priority => 10,
+ content => template("${module_name}/options.erb"),
+ require => Package['unattended-upgrades'],
+ notify_update => $notify_update,
+ }
}
diff --git a/manifests/params.pp b/manifests/params.pp
index e9a7605..29bc891 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -10,7 +10,10 @@ class unattended_upgrades::params {
$default_backup = { 'archive_interval' => 0, 'level' => 3, }
$default_age = { 'min' => 2, 'max' => 0, }
$default_upgradeable_packages = { 'download_only' => 0, 'debdelta' => 1, }
-
+ $default_options = { 'force_confdef' => true,
+ 'force_confold' => true,
+ 'force_confnew' => false,
+ 'force_confmiss' => false, }
# prior to puppet 3.5.0, defined couldn't test if a variable was defined
# strict variables wasn't added until 3.5.0, so this should be fine.
if ! $::settings::strict_variables {