]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/snmpd/recipes/default.rb
Use new style loading for cldr extension
[chef.git] / cookbooks / snmpd / recipes / default.rb
index fd852357f39518cdc1a3c394d2d93102f84e2764..b5bccce4be4fbdbb97df675acef1de42ed9e82b5 100644 (file)
@@ -37,11 +37,23 @@ template "/etc/snmp/snmpd.conf" do
   notifies :restart, "service[snmpd]"
 end
 
   notifies :restart, "service[snmpd]"
 end
 
-node[:snmpd][:clients].each do |address|
+if node[:snmpd][:clients]
+  node[:snmpd][:clients].each do |address|
+    firewall_rule "accept-snmp" do
+      action :accept
+      family "inet"
+      source "net:#{address}"
+      dest "fw"
+      proto "udp"
+      dest_ports "snmp"
+      source_ports "1024:"
+    end
+  end
+else
   firewall_rule "accept-snmp" do
     action :accept
     family "inet"
   firewall_rule "accept-snmp" do
     action :accept
     family "inet"
-    source "net:#{address}"
+    source "net"
     dest "fw"
     proto "udp"
     dest_ports "snmp"
     dest "fw"
     proto "udp"
     dest_ports "snmp"