Merge pull request #463 from mhaskel/toggle-legacy-origin

Allow changing legacy_origin
This commit is contained in:
Hunter Haugen 2015-03-13 15:29:20 -07:00
commit dbd1b0decb
3 changed files with 12 additions and 7 deletions

View file

@ -74,12 +74,13 @@ class { 'apt':
``` ```
class { 'apt::unattended_upgrades': class { 'apt::unattended_upgrades':
origins => $::apt::params::origins, legacy_origin => $::apt::params::legacy_origin,
blacklist => [], origins => $::apt::params::origins,
update => '1', blacklist => [],
download => '1', update => '1',
upgrade => '1', download => '1',
autoclean => '7', upgrade => '1',
autoclean => '7',
} }
``` ```
@ -277,6 +278,7 @@ apt::sources:
####apt::unattended_upgrades ####apt::unattended_upgrades
* `legacy_origin`: If set to true, use the old `Unattended-Upgrade::Allowed-Origins` variable. If false, use `Unattended-Upgrade::Origins-Pattern`. OS-dependent defaults are defined in `apt::params`.
* `origins`: The repositories from which to automatically upgrade included packages. * `origins`: The repositories from which to automatically upgrade included packages.
* `blacklist`: A list of packages to **not** automatically upgrade. * `blacklist`: A list of packages to **not** automatically upgrade.
* `update`: How often, in days, to run `apt-get update`. * `update`: How often, in days, to run `apt-get update`.

View file

@ -14,6 +14,7 @@
# file and in /etc/cron.daily/apt # file and in /etc/cron.daily/apt
# #
class apt::unattended_upgrades ( class apt::unattended_upgrades (
$legacy_origin = $::apt::params::legacy_origin,
$origins = $::apt::params::origins, $origins = $::apt::params::origins,
$blacklist = [], $blacklist = [],
$update = '1', $update = '1',
@ -40,6 +41,7 @@ class apt::unattended_upgrades (
) inherits ::apt::params { ) inherits ::apt::params {
validate_bool( validate_bool(
$legacy_origin,
$auto_fix, $auto_fix,
$minimal_steps, $minimal_steps,
$install_on_shutdown, $install_on_shutdown,

View file

@ -155,6 +155,7 @@ describe 'apt::unattended_upgrades', :type => :class do
let :params do let :params do
{ {
'legacy_origin' => true,
'enable' => '0', 'enable' => '0',
'backup_interval' => '3', 'backup_interval' => '3',
'backup_level' => '1', 'backup_level' => '1',
@ -181,7 +182,7 @@ describe 'apt::unattended_upgrades', :type => :class do
} }
end end
it { is_expected.to contain_file("/etc/apt/apt.conf.d/50unattended-upgrades").with_content %r{Unattended-Upgrade::Origins-Pattern \{\n\t"bananas";\n\};} } it { is_expected.to contain_file("/etc/apt/apt.conf.d/50unattended-upgrades").with_content %r{Unattended-Upgrade::Allowed-Origins \{\n\t"bananas";\n\};} }
it { is_expected.to contain_file("/etc/apt/apt.conf.d/50unattended-upgrades").with_content %r{Unattended-Upgrade::Package-Blacklist \{\n\t"foo";\n\t"bar";\n\};} } it { is_expected.to contain_file("/etc/apt/apt.conf.d/50unattended-upgrades").with_content %r{Unattended-Upgrade::Package-Blacklist \{\n\t"foo";\n\t"bar";\n\};} }
it { is_expected.to contain_file("/etc/apt/apt.conf.d/50unattended-upgrades").with_content %r{Unattended-Upgrade::AutoFixInterruptedDpkg "false";}} it { is_expected.to contain_file("/etc/apt/apt.conf.d/50unattended-upgrades").with_content %r{Unattended-Upgrade::AutoFixInterruptedDpkg "false";}}
it { is_expected.to contain_file("/etc/apt/apt.conf.d/50unattended-upgrades").with_content %r{Unattended-Upgrade::MinimalSteps "true";}} it { is_expected.to contain_file("/etc/apt/apt.conf.d/50unattended-upgrades").with_content %r{Unattended-Upgrade::MinimalSteps "true";}}