Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Puppet 5 support #742

Merged
merged 5 commits into from
Mar 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions manifests/startup.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@
# provided by camp2camp/systemd
if $facts['systemd'] {
contain systemd
file { "/etc/systemd/system/${name}.service":
ensure => file,
mode => '0664',
systemd::unit_file { "${name}.service":
content => template("zabbix/${service_name}-systemd.init.erb"),
}
~> Exec['systemctl-daemon-reload']
file { "/etc/init.d/${name}":
ensure => absent,
}
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 5.5.8 < 7.0.0"
"version_requirement": ">= 6.1.0 < 7.0.0"
}
],
"operatingsystem_support": [
Expand Down
12 changes: 9 additions & 3 deletions spec/acceptance/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@

# this will actually deploy apache + postgres + zabbix-server + zabbix-web
pp = <<-EOS
class { 'postgresql::server': } ->
class { 'zabbix::database': } ->
class { 'zabbix::server': }
class { 'postgresql::globals':
encoding => 'UTF-8',
locale => 'en_US.UTF-8',
manage_package_repo => true,
version => '12',
}
-> class { 'postgresql::server': }
-> class { 'zabbix::database': }
-> class { 'zabbix::server': }
EOS

prepare_host
Expand Down
8 changes: 7 additions & 1 deletion spec/acceptance/zabbix_application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ class { 'apache':
mpm_module => 'prefork',
}
include apache::mod::php
include postgresql::server
class { 'postgresql::globals':
encoding => 'UTF-8',
locale => 'en_US.UTF-8',
manage_package_repo => true,
version => '12',
}
-> class { 'postgresql::server': }

class { 'zabbix':
zabbix_version => '4.4',
Expand Down
14 changes: 7 additions & 7 deletions spec/acceptance/zabbix_host_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
# This will deploy a running Zabbix setup (server, web, db) which we can
# use for custom type tests
pp1 = <<-EOS
$compile_packages = $facts['os']['family'] ? {
'RedHat' => [ 'make', 'gcc-c++', 'rubygems', 'ruby'],
'Debian' => [ 'make', 'g++', 'ruby-dev', 'ruby', 'pkg-config',],
default => [],
}
ensure_packages($compile_packages, { before => Package['zabbixapi'], })
class { 'apache':
mpm_module => 'prefork',
}
include apache::mod::php
include postgresql::server
class { 'postgresql::globals':
encoding => 'UTF-8',
locale => 'en_US.UTF-8',
manage_package_repo => true,
version => '12',
}
-> class { 'postgresql::server': }

class { 'zabbix':
zabbix_version => '4.4',
Expand Down
8 changes: 7 additions & 1 deletion spec/acceptance/zabbix_hostgroup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ class { 'apache':
mpm_module => 'prefork',
}
include apache::mod::php
include postgresql::server
class { 'postgresql::globals':
encoding => 'UTF-8',
locale => 'en_US.UTF-8',
manage_package_repo => true,
version => '12',
}
-> class { 'postgresql::server': }

class { 'zabbix':
zabbix_version => '4.4',
Expand Down
14 changes: 7 additions & 7 deletions spec/acceptance/zabbix_proxy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
# This will deploy a running Zabbix setup (server, web, db) which we can
# use for custom type tests
pp1 = <<-EOS
$compile_packages = $facts['os']['family'] ? {
'RedHat' => [ 'make', 'gcc-c++', 'rubygems', 'ruby'],
'Debian' => [ 'make', 'g++', 'ruby-dev', 'ruby', 'pkg-config',],
default => [],
}
ensure_packages($compile_packages, { before => Package['zabbixapi'], })
class { 'apache':
mpm_module => 'prefork',
}
include apache::mod::php
include postgresql::server
class { 'postgresql::globals':
encoding => 'UTF-8',
locale => 'en_US.UTF-8',
manage_package_repo => true,
version => '12',
}
-> class { 'postgresql::server': }

class { 'zabbix':
zabbix_version => '4.4',
Expand Down
8 changes: 7 additions & 1 deletion spec/acceptance/zabbix_template_host_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ class { 'apache':
mpm_module => 'prefork',
}
include apache::mod::php
include postgresql::server
class { 'postgresql::globals':
encoding => 'UTF-8',
locale => 'en_US.UTF-8',
manage_package_repo => true,
version => '12',
}
-> class { 'postgresql::server': }

class { 'zabbix':
zabbix_version => '4.4',
Expand Down
8 changes: 7 additions & 1 deletion spec/acceptance/zabbix_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ class { 'apache':
mpm_module => 'prefork',
}
include apache::mod::php
include postgresql::server
class { 'postgresql::globals':
encoding => 'UTF-8',
locale => 'en_US.UTF-8',
manage_package_repo => true,
version => '12',
}
-> class { 'postgresql::server': }

class { 'zabbix':
zabbix_version => '4.4',
Expand Down
10 changes: 6 additions & 4 deletions spec/defines/startup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@
end

it { is_expected.to contain_class('systemd') }
it { is_expected.to contain_systemd__unit_file('zabbix-agent.service') }
it { is_expected.to contain_file('/etc/init.d/zabbix-agent').with_ensure('absent') }
it do
is_expected.to contain_file('/etc/systemd/system/zabbix-agent.service').with(
ensure: 'file',
mode: '0664'
).that_notifies('Exec[systemctl-daemon-reload]')
mode: '0444'
)
end
it { is_expected.to contain_file('/etc/systemd/system/zabbix-agent.service').with_content(%r{ExecStart=/usr/sbin/zabbix_agentd --foreground -c /something}) }
it { is_expected.to contain_file('/etc/systemd/system/zabbix-agent.service').with_content(%r{PIDFile=/somethingelse}) }
Expand Down Expand Up @@ -157,12 +158,13 @@
end

it { is_expected.to contain_class('systemd') }
it { is_expected.to contain_systemd__unit_file('zabbix-server.service') }
it { is_expected.to contain_file('/etc/init.d/zabbix-server').with_ensure('absent') }
it do
is_expected.to contain_file('/etc/systemd/system/zabbix-server.service').with(
ensure: 'file',
mode: '0664'
).that_notifies('Exec[systemctl-daemon-reload]')
mode: '0444'
)
end
it { is_expected.to contain_file('/etc/systemd/system/zabbix-server.service').with_content(%r{ExecStart=/usr/sbin/zabbix_server --foreground -c /something}) }
it { is_expected.to contain_file('/etc/systemd/system/zabbix-server.service').with_content(%r{PIDFile=/somethingelse}) }
Expand Down
11 changes: 11 additions & 0 deletions spec/support/acceptance/prepare_host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,15 @@ def prepare_host
fi
SHELL
shell(cleanup_script)
install_deps = <<-SHELL
$compile_packages = $facts['os']['family'] ? {
'RedHat' => [ 'make', 'gcc-c++', 'rubygems', 'ruby'],
'Debian' => [ 'make', 'g++', 'ruby-dev', 'ruby', 'pkg-config',],
default => [],
}
package { $compile_packages:
ensure => 'present',
}
SHELL
apply_manifest(install_deps)
end