Skip to content

Commit

Permalink
Merge pull request #247 from kenyon/focal
Browse files Browse the repository at this point in the history
Support Ubuntu 20.04; Drop EoL Debian 8, Ubuntu 16.04
  • Loading branch information
ghoneycutt authored Aug 23, 2021
2 parents c84ed0c + 38812e8 commit 0ed3262
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fixtures:
repositories:
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
systemd: 'https://github.com/camptocamp/puppet-systemd.git'
systemd: 'https://github.com/voxpupuli/puppet-systemd.git'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Net-SNMP module support is available with these operating systems:

* RedHat family - tested on CentOS 7
* SuSE family - tested on SLES 11 SP1
* Debian family - tested on Debian 8, Debian 9, Ubuntu 14.04, Ubuntu 16.04, Ubuntu 18.04
* Debian family - tested on Debian 9, Debian 10, Ubuntu 18.04, Ubuntu 20.04

### Notes:

Expand Down
4 changes: 4 additions & 0 deletions data/os/Debian/20.04.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
snmp::snmpd_options: "-Lsd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux -p /var/run/snmpd.pid"
snmp::varnetsnmp_group: 'Debian-snmp'
snmp::varnetsnmp_owner: 'Debian-snmp'
7 changes: 3 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version_requirement": ">= 5.2.0 < 8.0.0"
},
{
"name": "camptocamp/systemd",
"name": "puppet/systemd",
"version_requirement": ">= 2.5.1 < 4.0.0"
}
],
Expand Down Expand Up @@ -50,16 +50,15 @@
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"8",
"9",
"10"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"16.04",
"18.04"
"18.04",
"20.04"
]
}
],
Expand Down
59 changes: 19 additions & 40 deletions spec/classes/snmp_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@
).that_requires('Package[snmpd]').that_notifies('Service[snmpd]')
}
case facts[:os]['release']['major']
when '8', '9', '10', '16.04', '18.04'
when '8', '9', '10', '16.04', '18.04', '20.04'
it {
is_expected.to contain_file('snmptrapd.sysconfig').with(
ensure: 'present',
Expand Down Expand Up @@ -674,7 +674,7 @@
).that_requires('Package[snmpd]')
}
end
when '18.04'
when '18.04', '20.04'
describe 'Debian-snmp as snmp user' do
it 'contains File[snmpd.sysconfig] with contents "SNMPDOPTS="-Lsd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux -p /var/run/snmpd.pid""' do
verify_contents(catalogue, 'snmpd.sysconfig', [
Expand Down Expand Up @@ -712,46 +712,25 @@
end
end

case facts[:os]['release']['major']
when '8', '9', '10', '16.04', '18.04'
describe 'service_ensure => stopped and trap_service_ensure => running' do
let :params do
{
service_ensure: 'stopped',
trap_service_ensure: 'running'
}
end

it { is_expected.to contain_service('snmpd').with_ensure('running') }
it { is_expected.to contain_service('snmptrapd').with_ensure('running') }
it 'contains File[snmpd.sysconfig] with content "SNMPDRUN=no"' do
verify_contents(catalogue, 'snmpd.sysconfig', [
'SNMPDRUN=no'
])
end
it 'contains File[snmptrapd.sysconfig] with content "TRAPDRUN=yes"' do
verify_contents(catalogue, 'snmptrapd.sysconfig', [
'TRAPDRUN=yes'
])
end
describe 'service_ensure => stopped and trap_service_ensure => running' do
let :params do
{
service_ensure: 'stopped',
trap_service_ensure: 'running'
}
end
else
describe 'service_ensure => stopped and trap_service_ensure => running' do
let :params do
{
service_ensure: 'stopped',
trap_service_ensure: 'running'
}
end

it { is_expected.to contain_service('snmpd').with_ensure('running') }
it { is_expected.not_to contain_service('snmptrapd') }
it 'contains File[snmpd.sysconfig] with contents "SNMPDRUN=no" and "TRAPDRUN=yes"' do
verify_contents(catalogue, 'snmpd.sysconfig', [
'SNMPDRUN=no',
'TRAPDRUN=yes'
])
end
it { is_expected.to contain_service('snmpd').with_ensure('running') }
it { is_expected.to contain_service('snmptrapd').with_ensure('running') }
it 'contains File[snmpd.sysconfig] with content "SNMPDRUN=no"' do
verify_contents(catalogue, 'snmpd.sysconfig', [
'SNMPDRUN=no'
])
end
it 'contains File[snmptrapd.sysconfig] with content "TRAPDRUN=yes"' do
verify_contents(catalogue, 'snmptrapd.sysconfig', [
'TRAPDRUN=yes'
])
end
end

Expand Down

0 comments on commit 0ed3262

Please sign in to comment.