agent: Require startup script for the service
MODIFY
manifests/agent.pp
manifests/agent.pp
@@ -312,11 +312,16 @@ class zabbix::agent (
}
}
+ $service_require = $manage_startup_script ? {
+ true => [Package[$zabbix_package_agent], Zabbix::Startup[$servicename]],
+ false => Package[$zabbix_package_agent]
+ }
+
# Controlling the 'zabbix-agent' service
service { $servicename:
ensure => $service_ensure,
enable => $service_enable,
- require => Package[$zabbix_package_agent],
+ require => $service_require,
}
# Override the service provider on AIX

MODIFY
spec/classes/agent_spec.rb
spec/classes/agent_spec.rb
@@ -82,7 +82,7 @@ describe 'zabbix::agent' do
with_ensure('running').
with_enable(true).
with_service_provider(facts[:osfamily] == 'AIX' ? 'init' : nil).
- that_requires("Package[#{package_name}]")
+ that_requires(["Package[#{package_name}]", "Zabbix::Startup[#{service_name}]"])
end
it { is_expected.to contain_file(include_dir).with_ensure('directory') }

agent: Require startup script for the service

Signed-off-by: Christos Papageorgiou <christos.papageorgioy@gmail.com>