]> git.openstreetmap.org Git - chef.git/commitdiff
Update SNMP configuration for lyonix
authorTom Hughes <tom@compton.nu>
Mon, 22 Jun 2020 19:55:09 +0000 (20:55 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 22 Jun 2020 20:03:51 +0000 (21:03 +0100)
cookbooks/snmpd/recipes/default.rb
cookbooks/snmpd/templates/default/snmpd.conf.erb
roles/lyonix.rb

index ccafc831cc98bd1a6f37aea7f608fd822514f134..10353914cff9675b2186804596196dda2eb8ee83 100644 (file)
@@ -60,3 +60,27 @@ else
     source_ports "1024:"
   end
 end
     source_ports "1024:"
   end
 end
+
+if node[:snmpd][:clients6]
+  node[:snmpd][:clients6].each do |address|
+    firewall_rule "accept-snmp" do
+      action :accept
+      family "inet6"
+      source "net:#{address}"
+      dest "fw"
+      proto "udp"
+      dest_ports "snmp"
+      source_ports "1024:"
+    end
+  end
+else
+  firewall_rule "accept-snmp" do
+    action :accept
+    family "inet6"
+    source "net"
+    dest "fw"
+    proto "udp"
+    dest_ports "snmp"
+    source_ports "1024:"
+  end
+end
index 9239fbd309aaa7a90836264e51edd436578b0521..e47f2e03fd432cc3ab023650ff1e3d3b391f380e 100644 (file)
@@ -1,6 +1,9 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
 # DO NOT EDIT - This file is being maintained by Chef
 
-rocommunity     <%= @communities[node[:snmpd][:community]] %>
+<% @communities[node[:snmpd][:community]].each do |community| -%>  
+rocommunity     <%= community %>
+rocommunity6    <%= community %>
+<% end -%>
 syslocation     <%= node[:snmpd][:location] %>
 <% if node[:snmpd][:contact] -%>
 syscontact      <%= node[:snmpd][:contact] %>
 syslocation     <%= node[:snmpd][:location] %>
 <% if node[:snmpd][:contact] -%>
 syscontact      <%= node[:snmpd][:contact] %>
index faf838dac0bbbf67a35890f03fff80064ddc879f..715f6a84803d6a03e67c25fc6aba402f6669856e 100644 (file)
@@ -8,7 +8,8 @@ default_attributes(
     :nameservers => ["77.95.64.205", "77.95.64.206", "8.8.8.8", "8.8.4.4"]
   },
   :snmpd => {
     :nameservers => ["77.95.64.205", "77.95.64.206", "8.8.8.8", "8.8.4.4"]
   },
   :snmpd => {
-    :clients => ["77.95.64.0/24", "77.95.70.0/24"],
+    :clients => ["77.95.64.0/21"],
+    :clients6 => ["2a03:9180::/32", "2001:7f8:47::/48"],
     :community => "lyonix",
     :location => "LYON",
     :contact => "noc@lyonix.net"
     :community => "lyonix",
     :location => "LYON",
     :contact => "noc@lyonix.net"