#
# Cookbook: nrpe-ng
# License: Apache 2.0
#
# Copyright 2015-2016, Bloomberg Finance L.P.
#
poise_service_user node['nrpe-ng']['service_user'] do
  group node['nrpe-ng']['service_group']
  home node['nrpe-ng']['service_home']
  not_if { user == 'root' }
end

install = nrpe_installation node['nrpe-ng']['service_name'] do
  notifies :reload, "nrpe_service[#{name}]", :delayed
end

config = nrpe_config node['nrpe-ng']['service_name'] do |r|
  owner node['nrpe-ng']['service_user']
  group node['nrpe-ng']['service_group']
  node['nrpe-ng']['config'].each_pair { |k, v| r.send(k, v) }
  notifies :reload, "nrpe_service[#{name}]", :delayed
end

nrpe_service node['nrpe-ng']['service_name'] do
  user node['nrpe-ng']['service_user']
  group node['nrpe-ng']['service_group']
  directory node['nrpe-ng']['service_home']
  program install.nrpe_program
  plugin_path install.nagios_plugins
end

#
# Cookbook: nrpe-ng
# License: Apache 2.0
#
# Copyright 2015-2016, Bloomberg Finance L.P.
#
poise_service_user node['nrpe-ng']['service_user'] do
  group node['nrpe-ng']['service_group']
  home node['nrpe-ng']['service_home']
  not_if { user == 'root' }
end

install = nrpe_installation node['nrpe-ng']['service_name'] do
  notifies :reload, "nrpe_service[#{name}]", :delayed
end

config = nrpe_config node['nrpe-ng']['service_name'] do |r|
  owner node['nrpe-ng']['service_user']
  group node['nrpe-ng']['service_group']
  node['nrpe-ng']['config'].each_pair { |k, v| r.send(k, v) }
  notifies :reload, "nrpe_service[#{name}]", :delayed
end

nrpe_service node['nrpe-ng']['service_name'] do
  user node['nrpe-ng']['service_user']
  group node['nrpe-ng']['service_group']
  directory node['nrpe-ng']['service_home']
  config_file config.path
  program install.nrpe_program
  plugin_path install.nagios_plugins
end

Fix configuration file not being passed into service.
Fix configuration file not being passed into service.
