summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Souter <peter.souter+GIT@puppet.com>2017-07-07 14:14:07 +0100
committerVarac <varac@leap.se>2017-10-13 14:58:19 +0200
commite1b57ba45730e7f7b2005a2f4619ef927dbb956f (patch)
treefb2cdbc1b4b2792066fc9b32f267d85dd7c5d36d
parente1d242de5e969d7348a5aaf8a1b224593f1bfb58 (diff)
Adds Debian 9 - Stretch Supportpuppet3
* Stretch is now stable * Add Stretch to metadata.json * Updates specs (Waiting in FacterDB support)
-rw-r--r--manifests/params.pp6
-rw-r--r--spec/classes/debian_spec.rb67
2 files changed, 57 insertions, 16 deletions
diff --git a/manifests/params.pp b/manifests/params.pp
index 0d205a9..4004f6c 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -65,6 +65,12 @@ class unattended_upgrades::params {
'origin=Debian,archive=oldstable,label=Debian-Security',
]
}
+ 'stretch': {
+ $legacy_origin = false
+ $origins = [
+ 'origin=Debian,archive=stable,label=Debian-Security',
+ ]
+ }
default: {
$legacy_origin = false
$origins = ['origin=Debian,codename=${distro_codename},label=Debian-Security',] #lint:ignore:single_quote_string_with_variables
diff --git a/spec/classes/debian_spec.rb b/spec/classes/debian_spec.rb
index bbfd354..642c0ba 100644
--- a/spec/classes/debian_spec.rb
+++ b/spec/classes/debian_spec.rb
@@ -78,9 +78,9 @@ describe 'unattended_upgrades' do
path: '/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin')
end
- case facts[:operatingsystem]
- when 'Debian'
+ if facts[:operatingsystem] == 'Debian'
it_behaves_like 'Debian specs'
+
case facts[:lsbdistcodename]
when 'squeeze'
context 'with defaults on Debian 6 Squeeze' do
@@ -128,23 +128,58 @@ describe 'unattended_upgrades' do
)
end
end
- end
- when 'stretch'
- context 'with defaults on Debian 9 Stretch' do
- it do
- is_expected.to create_file(file_unattended).with(
- owner: 'root',
- group: 'root',
- mode: '0644'
- ).with_content(
- # This section varies for different releases
- /\Unattended-Upgrade::Origins-Pattern\ {\n
- \t"origin=Debian,archive=oldstable,label=Debian-Security";\n
- };/x
- )
+ # Won't work until FacterDB adds Stretch support
+ when 'stretch'
+ context 'with defaults on Debian 9 Stretch' do
+ it do
+ is_expected.to create_file(file_unattended).with(
+ owner: 'root',
+ group: 'root',
+ mode: '0644'
+ ).with_content(
+ # This section varies for different releases
+ /\Unattended-Upgrade::Origins-Pattern\ {\n
+ \t"origin=Debian,archive=oldstable,label=Debian-Security";\n
+ };/x
+ )
+ end
end
end
end
end
end
+
+ # Adding Stretch Spec until FacterDB adds Stretch
+ context 'with defaults on Debian 9 Stretch' do
+ let(:facts) do
+ {
+ osfamily: 'Debian',
+ lsbdistid: 'Debian',
+ os: {
+ name: 'Debian',
+ family: 'Debian',
+ release: {
+ full: '9.0'
+ }
+ },
+ lsbdistcodename: 'stretch',
+ lsbrelease: '9.0'
+ }
+ end
+
+ it_behaves_like 'Debian specs'
+
+ it do
+ is_expected.to create_file(file_unattended).with(
+ owner: 'root',
+ group: 'root',
+ mode: '0644'
+ ).with_content(
+ # This section varies for different releases
+ /\Unattended-Upgrade::Origins-Pattern\ {\n
+ \t"origin=Debian,archive=stable,label=Debian-Security";\n
+ };/x
+ )
+ end
+ end
end