summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Meusel <tim@bastelfreak.de>2016-02-05 14:09:19 +0100
committerTim Meusel <tim@bastelfreak.de>2016-02-05 14:09:19 +0100
commit322fe9e3030cab94b3815323b89405a9e16c0498 (patch)
treed578f74cb6b394a54b71075e6e46f56ab1783a43
parent07187bbd2f494c0e2a70fae0cbc55136b568a07b (diff)
parente1a312abef9d77217e577e2813f62bf09c435926 (diff)
Merge pull request #51 from voxpupuli/no-notify-update
Default `notify_update` to false
-rw-r--r--Gemfile2
-rw-r--r--manifests/init.pp2
-rw-r--r--spec/classes/unattended_upgrades_spec.rb89
3 files changed, 49 insertions, 44 deletions
diff --git a/Gemfile b/Gemfile
index 4e19aed..8fa35da 100644
--- a/Gemfile
+++ b/Gemfile
@@ -19,7 +19,7 @@ group :test do
gem 'rspec', :require => false
gem 'puppet-blacksmith', :require => false, :git => 'https://github.com/voxpupuli/puppet-blacksmith.git'
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem.git'
- gem 'rubocop', :require => false
+ gem 'rubocop', '0.35.0', :require => false
gem 'rspec-puppet-utils', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint-absolute_classname-check', :require => false
diff --git a/manifests/init.pp b/manifests/init.pp
index 3d9f2df..489db32 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -17,7 +17,7 @@ class unattended_upgrades (
$upgrade = 1,
$upgradeable_packages = {},
$verbose = 0,
- $notify_update = undef,
+ $notify_update = false,
) inherits ::unattended_upgrades::params {
if $legacy_origin == undef or $origins == undef {
diff --git a/spec/classes/unattended_upgrades_spec.rb b/spec/classes/unattended_upgrades_spec.rb
index a630648..5943f02 100644
--- a/spec/classes/unattended_upgrades_spec.rb
+++ b/spec/classes/unattended_upgrades_spec.rb
@@ -18,21 +18,23 @@ describe 'unattended_upgrades' do
it {
should contain_apt__conf('unattended-upgrades').with(
- 'require' => 'Package[unattended-upgrades]',
+ :require => 'Package[unattended-upgrades]',
+ :notify_update => false,
)
}
it {
should contain_apt__conf('periodic').with(
- 'require' => 'Package[unattended-upgrades]',
+ :require => 'Package[unattended-upgrades]',
+ :notify_update => false,
)
}
it {
should create_file(file_unattended).with(
- 'owner' => 'root',
- 'group' => 'root',
- 'mode' => '0644',
+ :owner => 'root',
+ :group => 'root',
+ :mode => '0644',
).with_content(
/Unattended-Upgrade::Origins-Pattern {/
).with_content(
@@ -58,9 +60,9 @@ describe 'unattended_upgrades' do
it {
should create_file(file_periodic).with(
- 'owner' => 'root',
- 'group' => 'root',
- 'mode' => '0644',
+ :owner => 'root',
+ :group => 'root',
+ :mode => '0644',
).with_content(
/APT::Periodic::Enable "1";/
).with_content(
@@ -89,7 +91,7 @@ describe 'unattended_upgrades' do
}
it { should contain_apt__conf('auto-upgrades').with(
- 'ensure' => 'absent',
+ :ensure => 'absent',
)
}
end
@@ -103,9 +105,9 @@ describe 'unattended_upgrades' do
} }
it {
should create_file(file_unattended).with(
- 'owner' => 'root',
- 'group' => 'root',
- 'mode' => '0644',
+ :owner => 'root',
+ :group => 'root',
+ :mode => '0644',
).with_content(
# This section varies for different releases
/\Unattended-Upgrade::Allowed-Origins\ {\n
@@ -126,9 +128,9 @@ describe 'unattended_upgrades' do
} }
it {
should create_file(file_unattended).with(
- 'owner' => 'root',
- 'group' => 'root',
- 'mode' => '0644',
+ :owner => 'root',
+ :group => 'root',
+ :mode => '0644',
).with_content(
# This section varies for different releases
/\Unattended-Upgrade::Origins-Pattern\ {\n
@@ -148,9 +150,9 @@ describe 'unattended_upgrades' do
} }
it {
should create_file(file_unattended).with(
- 'owner' => 'root',
- 'group' => 'root',
- 'mode' => '0644',
+ :owner => 'root',
+ :group => 'root',
+ :mode => '0644',
).with_content(
# This section varies for different releases
/\Unattended-Upgrade::Origins-Pattern\ {\n
@@ -169,9 +171,9 @@ describe 'unattended_upgrades' do
} }
it {
should create_file(file_unattended).with(
- 'owner' => 'root',
- 'group' => 'root',
- 'mode' => '0644',
+ :owner => 'root',
+ :group => 'root',
+ :mode => '0644',
).with_content(
# This is the only section that's different for Ubuntu compared to Debian
/\Unattended-Upgrade::Allowed-Origins\ {\n
@@ -190,9 +192,9 @@ describe 'unattended_upgrades' do
} }
it {
should create_file(file_unattended).with(
- 'owner' => 'root',
- 'group' => 'root',
- 'mode' => '0644',
+ :owner => 'root',
+ :group => 'root',
+ :mode => '0644',
).with_content(
# This is the only section that's different for Ubuntu compared to Debian
/\Unattended-Upgrade::Allowed-Origins\ {\n
@@ -211,9 +213,9 @@ describe 'unattended_upgrades' do
} }
it {
should create_file(file_unattended).with(
- 'owner' => 'root',
- 'group' => 'root',
- 'mode' => '0644',
+ :owner => 'root',
+ :group => 'root',
+ :mode => '0644',
).with_content(
# This is the only section that's different for Ubuntu compared to Debian
/\Unattended-Upgrade::Allowed-Origins\ {\n
@@ -232,9 +234,9 @@ describe 'unattended_upgrades' do
} }
it {
should create_file(file_unattended).with(
- 'owner' => 'root',
- 'group' => 'root',
- 'mode' => '0644',
+ :owner => 'root',
+ :group => 'root',
+ :mode => '0644',
).with_content(
# This is the only section that's different for Ubuntu compared to Debian
/\Unattended-Upgrade::Allowed-Origins\ {\n
@@ -253,9 +255,9 @@ describe 'unattended_upgrades' do
} }
it {
should create_file(file_unattended).with(
- 'owner' => 'root',
- 'group' => 'root',
- 'mode' => '0644',
+ :owner => 'root',
+ :group => 'root',
+ :mode => '0644',
)
}
end
@@ -289,25 +291,28 @@ describe 'unattended_upgrades' do
},
:dl_limit => 70,
:random_sleep => 300,
+ :notify_update => true,
}
end
it { should contain_package('unattended-upgrades') }
it { should contain_apt__conf('unattended-upgrades').with(
- 'require' => 'Package[unattended-upgrades]',
+ :require => 'Package[unattended-upgrades]',
+ :notify_update => true,
)
}
it { should contain_apt__conf('periodic').with(
- 'require' => 'Package[unattended-upgrades]',
+ :require => 'Package[unattended-upgrades]',
+ :notify_update => true,
)
}
it {
should create_file(file_unattended).with(
- 'owner' => 'root',
- 'group' => 'root',
- 'mode' => '0644',
+ :owner => 'root',
+ :group => 'root',
+ :mode => '0644',
).with_content(
/Unattended-Upgrade::Allowed-Origins {\n\t"bananas";\n};/
).with_content(
@@ -333,9 +338,9 @@ describe 'unattended_upgrades' do
it {
should create_file(file_periodic).with(
- 'owner' => 'root',
- 'group' => 'root',
- 'mode' => '0644',
+ :owner => 'root',
+ :group => 'root',
+ :mode => '0644',
).with_content(
/APT::Periodic::Enable "1";/
).with_content(
@@ -367,7 +372,7 @@ describe 'unattended_upgrades' do
it {
should contain_apt__conf('auto-upgrades').with(
- 'ensure' => 'absent',
+ :ensure => 'absent',
)
}
end