From c570b6b0493c00ebe4db775df34d384b2777d0b2 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 15 Jul 2022 22:45:33 +0100 Subject: [PATCH] Ensure snmpd.conf is created before starting snmpd --- cookbooks/snmpd/recipes/default.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cookbooks/snmpd/recipes/default.rb b/cookbooks/snmpd/recipes/default.rb index 98e4c400b..26ae86b78 100644 --- a/cookbooks/snmpd/recipes/default.rb +++ b/cookbooks/snmpd/recipes/default.rb @@ -23,11 +23,6 @@ communities = data_bag_item("snmpd", "communities") package "snmpd" -service "snmpd" do - action [:enable, :start] - supports :status => true, :restart => true -end - template "/etc/snmp/snmpd.conf" do source "snmpd.conf.erb" owner "root" @@ -37,6 +32,11 @@ template "/etc/snmp/snmpd.conf" do notifies :restart, "service[snmpd]" end +service "snmpd" do + action [:enable, :start] + supports :status => true, :restart => true +end + if node[:snmpd][:clients] node[:snmpd][:clients].each do |address| firewall_rule "accept-snmp" do -- 2.39.5