Add Ubuntu 18.04 and 20.04 support
MODIFY
metadata.json
metadata.json
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
- "16.04"
+ "16.04",
+ "18.04",
+ "20.04"
]
},
{

MODIFY
spec/acceptance/zabbix_application_spec.rb
spec/acceptance/zabbix_application_spec.rb
@@ -10,8 +10,10 @@ describe 'zabbix_application type', unless: default[:platform] =~ %r{(ubuntu-16.
template = case zabbix_version
when '4.0'
'Template OS Linux'
- else
+ when '5.0'
'Template OS Linux by Zabbix agent'
+ else
+ 'Linux by Zabbix agent'
end
context "create zabbix_application resources with zabbix version #{zabbix_version}" do

MODIFY
spec/acceptance/zabbix_host_spec.rb
spec/acceptance/zabbix_host_spec.rb
@@ -12,9 +12,11 @@ describe 'zabbix_host type', unless: default[:platform] =~ %r{(ubuntu-16.04|debi
template = case zabbix_version
when '4.0'
- 'Template OS Linux'
+ ['Template OS Linux', 'Template Module ICMP Ping']
+ when '5.0'
+ ['Template OS Linux by Zabbix agent', 'Template Module ICMP Ping']
else
- 'Template OS Linux by Zabbix agent'
+ ['Linux by Zabbix agent', 'ICMP Ping']
end
pp1 = <<-EOS
@@ -65,7 +67,7 @@ describe 'zabbix_host type', unless: default[:platform] =~ %r{(ubuntu-16.04|debi
port => 10050,
groups => ['TestgroupOne'],
group_create => true,
- templates => [ "#{template}", ],
+ templates => #{template},
macros => [],
}
@@ -74,7 +76,7 @@ describe 'zabbix_host type', unless: default[:platform] =~ %r{(ubuntu-16.04|debi
use_ip => false,
port => 1050,
groups => ['Virtual machines'],
- templates => [ "#{template}", 'Template Module ICMP Ping', ],
+ templates => #{template},
macros => [],
}
EOS
@@ -120,7 +122,7 @@ describe 'zabbix_host type', unless: default[:platform] =~ %r{(ubuntu-16.04|debi
expect(test1['interfaces'][0]['useip']).to eq('1')
end
it 'has templates attached' do
- expect(test1['parentTemplates'].map { |t| t['host'] }.sort).to eq([template])
+ expect(test1['parentTemplates'].map { |t| t['host'] }.sort).to eq(template.sort)
end
end
@@ -152,7 +154,7 @@ describe 'zabbix_host type', unless: default[:platform] =~ %r{(ubuntu-16.04|debi
expect(test2['interfaces'][0]['useip']).to eq('0')
end
it 'has templates attached' do
- expect(test2['parentTemplates'].map { |t| t['host'] }.sort).to eq(['Template Module ICMP Ping', template])
+ expect(test2['parentTemplates'].map { |t| t['host'] }.sort).to eq(template.sort)
end
end
end

MODIFY
spec/acceptance/zabbix_template_host_spec.rb
spec/acceptance/zabbix_template_host_spec.rb
@@ -10,8 +10,10 @@ describe 'zabbix_template_host type', unless: default[:platform] =~ %r{(ubuntu-1
template = case zabbix_version
when '4.0'
'Template OS Linux'
- else
+ when '5.0'
'Template OS Linux by Zabbix agent'
+ else
+ 'Linux by Zabbix agent'
end

MODIFY
spec/support/acceptance/prepare_host.rb
spec/support/acceptance/prepare_host.rb
@@ -7,8 +7,15 @@ def prepare_host
shell('sed -i "/nodocs/d" /etc/yum.conf')
end
end
+
+ if fact('os.family') == 'Debian'
+ shell('rm -f /etc/dpkg/dpkg.cfg.d/excludes')
+ end
+
cleanup_script = <<-SHELL
/opt/puppetlabs/bin/puppet resource service zabbix-server ensure=stopped
+ /opt/puppetlabs/bin/puppet resource service apache2 ensure=stopped
+ /opt/puppetlabs/bin/puppet resource service httpd ensure=stopped
/opt/puppetlabs/bin/puppet resource package zabbix-server-pgsql ensure=purged
/opt/puppetlabs/bin/puppet resource package zabbix-server-pgsql-scl ensure=purged
/opt/puppetlabs/bin/puppet resource package zabbix-server-mysql ensure=purged

Add Ubuntu 18.04 and 20.04 support

Signed-off-by: Christos Papageorgiou <root.expert.xda@gmail.com>