Skip to content

Instantly share code, notes, and snippets.

@skihero
Created October 27, 2014 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skihero/67a0083d84292d2d197e to your computer and use it in GitHub Desktop.
Save skihero/67a0083d84292d2d197e to your computer and use it in GitHub Desktop.
Include a conf directory and a file from the template, chef
include_dir = "#{node['nrpe']['conf_dir']}/nrpe.d"
directory include_dir do
owner node['nrpe']['user']
group node['nrpe']['group']
mode '0755'
end
template "#{node['nrpe']['conf_dir']}/nrpe.cfg" do
source 'nrpe.cfg.erb'
owner node['nrpe']['user']
group node['nrpe']['group']
mode '0644'
variables(
:mon_host => mon_host.uniq.sort,
:nrpe_directory => include_dir
)
notifies :restart, "service[#{node['nrpe']['service_name']}]"
end
service node['nrpe']['service_name'] do
action [:start, :enable]
supports :restart => true, :reload => true, :status => true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment