diff options
author | Joseph (Jy) Yaworski <jyaworski@carotid.us> | 2016-04-02 00:41:54 -0400 |
---|---|---|
committer | Joseph (Jy) Yaworski <jyaworski@carotid.us> | 2016-04-02 00:41:54 -0400 |
commit | 9c9c140ce32395afcf8d9b5d8e4f92e4e3bb3007 (patch) | |
tree | 6908974fb30b0b99c8d70c1939511f489d43033e /manifests | |
parent | 1ddfcea4c298cbe6236622020ec440e5e0633341 (diff) | |
parent | 3a4abe4f98d4c24989a1def59968cb49d1d26268 (diff) |
Merge pull request #52 from icann-dns/add_config_options
add options support
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/init.pp | 13 | ||||
-rw-r--r-- | manifests/params.pp | 5 |
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 { |