diff --git a/recipes/plugin_cfg.rb b/recipes/plugin_cfg.rb index 355a909..ead5100 100644 --- a/recipes/plugin_cfg.rb +++ b/recipes/plugin_cfg.rb @@ -10,13 +10,20 @@ package 'nagios-plugins-basic' do only_if { node[:monasca_agent][:plugin].key?(:nagios_wrapper) } end +# Create the conf.d directory if it doesn't exist +directory '/etc/monasca/agent/conf.d' do + owner node[:monasca_agent][:owner] + group node[:monasca_agent][:group] + recursive true +end + # Configures the plugin yaml files based on node[:monasca_agent][:plugin] # attributes node[:monasca_agent][:plugin].each_key do |plugin| unless node[:monasca_agent][:plugin][plugin].key?(:init_config) node.normal[:monasca_agent][:plugin][plugin][:init_config] = {} end - template "/etc/monasca-agent/conf.d/#{plugin}.yaml" do + template "/etc/monasca/agent/conf.d/#{plugin}.yaml" do source 'plugin_yaml.erb' action :create owner node[:monasca_agent][:owner]