diff --git a/attributes/default.rb b/attributes/default.rb index f235dd6..bafcf00 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -13,12 +13,13 @@ else default['zabbix']['etc_dir'] = '/etc/zabbix' end -default['zabbix']['install_dir'] = '/opt/zabbix' -default['zabbix']['web_dir'] = '/opt/zabbix/web' -default['zabbix']['external_dir'] = '/opt/zabbix/externalscripts' -default['zabbix']['alert_dir'] = '/opt/zabbix/AlertScriptsPath' +default['zabbix']['root_dir'] = '/opt' +default['zabbix']['install_dir'] = "#{node['zabbix']['root_dir']}/zabbix" +default['zabbix']['web_dir'] = "#{node['zabbix']['root_dir']}/zabbix/web" +default['zabbix']['external_dir'] = "#{node['zabbix']['root_dir']}/zabbix/externalscripts" +default['zabbix']['alert_dir'] = "#{node['zabbix']['root_dir']}/zabbix/AlertScriptsPath" default['zabbix']['lock_dir'] = '/var/lock/subsys' -default['zabbix']['src_dir'] = '/opt' +default['zabbix']['src_dir'] = node['zabbix']['root_dir'] default['zabbix']['log_dir'] = '/var/log/zabbix' default['zabbix']['run_dir'] = '/var/run/zabbix' @@ -26,5 +27,5 @@ default['zabbix']['group'] = 'zabbix' default['zabbix']['uid'] = nil default['zabbix']['gid'] = nil -default['zabbix']['home'] = '/opt/zabbix' +default['zabbix']['home'] = "#{node['zabbix']['root_dir']}/zabbix" default['zabbix']['shell'] = '/bin/bash' diff --git a/attributes/server.rb b/attributes/server.rb index bff34b1..6c2e34a 100644 --- a/attributes/server.rb +++ b/attributes/server.rb @@ -5,7 +5,7 @@ default['zabbix']['server']['source_url'] = nil default['zabbix']['server']['install_method'] = 'source' default['zabbix']['server']['configure_options'] = ['--with-libcurl', '--with-net-snmp'] -default['zabbix']['server']['include_dir'] = '/opt/zabbix/server_include' +default['zabbix']['server']['include_dir'] = "#{node['zabbix']['root_dir']}/zabbix/server_include" default['zabbix']['server']['log_file'] = ::File.join(node['zabbix']['log_dir'], 'zabbix_server.log') default['zabbix']['server']['log_level'] = 3 default['zabbix']['server']['housekeeping_frequency'] = '1' diff --git a/recipes/agent_prebuild.rb b/recipes/agent_prebuild.rb index cba2d24..0daa53a 100644 --- a/recipes/agent_prebuild.rb +++ b/recipes/agent_prebuild.rb @@ -18,7 +18,7 @@ owner node['zabbix']['agent']['user'] group node['zabbix']['agent']['group'] action :put - path '/opt' + path node['zabbix']['root_dir'] strip_components 0 has_binaries ['bin/zabbix_sender', 'bin/zabbix_get', 'sbin/zabbix_agent', 'sbin/zabbix_agentd'] notifies :restart, 'service[zabbix_agentd]'