Skip to content

Commit

Permalink
Merge pull request #376 from raoulbhatia/unattended-upgrades-oldstable
Browse files Browse the repository at this point in the history
Unattended upgrades oldstable for wheezy
  • Loading branch information
daenney committed Nov 13, 2014
2 parents 06cffcd + 15fad7e commit 84340fd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion manifests/builddep.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
exec { "apt-builddep-${name}":
command => "/usr/bin/apt-get -y --force-yes build-dep ${name}",
logoutput => 'on_failure',
require => Exec['apt_update'],
require => Exec['apt_update'],
}

# Need anchor to provide containment for dependencies.
Expand Down
12 changes: 6 additions & 6 deletions manifests/force.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
}

case $cfg_files {
'new': { $config_files = '-o Dpkg::Options::="--force-confnew"' }
'old': { $config_files = '-o Dpkg::Options::="--force-confold"' }
'unchanged': { $config_files = '-o Dpkg::Options::="--force-confdef"' }
'none': { $config_files = '' }
'new': { $config_files = '-o Dpkg::Options::="--force-confnew"' }
'old': { $config_files = '-o Dpkg::Options::="--force-confold"' }
'unchanged': { $config_files = '-o Dpkg::Options::="--force-confdef"' }
'none', default: { $config_files = '' }
}

case $cfg_missing {
true: { $config_missing = '-o Dpkg::Options::="--force-confmiss"' }
false: { $config_missing = '' }
true: { $config_missing = '-o Dpkg::Options::="--force-confmiss"' }
false, default: { $config_missing = '' }
}

if $version == false {
Expand Down
3 changes: 2 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
'wheezy': {
$backports_location = 'http://ftp.debian.org/debian/'
$legacy_origin = false
$origins = ['origin=Debian,archive=stable,label=Debian-Security']
$origins = ['origin=Debian,archive=stable,label=Debian-Security',
'origin=Debian,archive=oldstable,label=Debian-Security']
}
default: {
$backports_location = 'http://http.debian.net/debian/'
Expand Down
11 changes: 11 additions & 0 deletions spec/classes/unattended_upgrades_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,17 @@
it { is_expected.to_not contain_file("/etc/apt/apt.conf.d/10periodic").with_content %r{APT::Periodic::RandomSleep}}
end

context 'wheezy' do
let :facts do
{
'lsbdistid' => 'debian',
'lsbdistcodename' => 'wheezy',
}
end

it { is_expected.to contain_file("/etc/apt/apt.conf.d/50unattended-upgrades").with_content %r{Unattended-Upgrade::Origins-Pattern \{\n\t"origin=Debian,archive=stable,label=Debian-Security";\n\t"origin=Debian,archive=oldstable,label=Debian-Security";\n\};} }
end

context 'anything but defaults' do
let :facts do
{
Expand Down

0 comments on commit 84340fd

Please sign in to comment.