44 lines
896 B
Ruby
44 lines
896 B
Ruby
#
|
|
# Cookbook Name:: zabbix
|
|
# Recipe:: proxy
|
|
#
|
|
# Copyright 2017, Linux-Help.org
|
|
# Authors:
|
|
# Eric Renfro <psi-jack@linux-help.org>
|
|
#
|
|
|
|
%w{zabbix-proxy-sqlite3 zabbix-get}.each do |pkg|
|
|
yum_package pkg do
|
|
version '3.0.5-1.el6'
|
|
allow_downgrade true
|
|
action :install
|
|
end
|
|
end
|
|
|
|
directory "/var/lib/zabbix" do
|
|
owner 'zabbix'
|
|
group 'zabbix'
|
|
mode '0750'
|
|
action :create
|
|
end
|
|
|
|
template "/etc/zabbix/zabbix_proxy.conf" do
|
|
credentials = Chef::EncryptedDataBagItem.load("odhp_credentials", "credentials")
|
|
variables({
|
|
:DBPassword => credentials['zabbix']['postgres_password']
|
|
})
|
|
source "zabbix_proxy.conf.erb"
|
|
sensitive true
|
|
mode "0640"
|
|
owner "root"
|
|
group "root"
|
|
notifies :restart, "service[zabbix-proxy]", :immediately
|
|
end
|
|
|
|
service 'zabbix-proxy' do
|
|
supports :restart => true, :start => true
|
|
action :enable
|
|
end
|
|
|
|
include_recipe 'zabbix::agent'
|
|
|