]> git.openstreetmap.org Git - chef.git/commitdiff
Ensure snmpd.conf is created before starting snmpd
authorTom Hughes <tom@compton.nu>
Fri, 15 Jul 2022 21:45:33 +0000 (22:45 +0100)
committerTom Hughes <tom@compton.nu>
Sat, 16 Jul 2022 14:07:30 +0000 (15:07 +0100)
cookbooks/snmpd/recipes/default.rb

index 98e4c400b7421164aecccf85ac72560f69806868..26ae86b784ef4f9f6a1bd7f9ee4dc129603c7bc0 100644 (file)
@@ -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