]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/logstash/recipes/default.rb
Use postgis 2.4 on rhaegal
[chef.git] / cookbooks / logstash / recipes / default.rb
index cc28afab826a288874984dc79719202b147632b4..620194df8973c596608c69d662cbfa697d6d292c 100644 (file)
@@ -26,16 +26,16 @@ package %w[
   logstash
 ]
 
-cookbook_file "/var/lib/logstash/lumberjack.crt" do
-  source "lumberjack.crt"
+cookbook_file "/var/lib/logstash/beats.crt" do
+  source "beats.crt"
   user "root"
   group "logstash"
   mode 0o644
   notifies :restart, "service[logstash]"
 end
 
-file "/var/lib/logstash/lumberjack.key" do
-  content keys["lumberjack"].join("\n")
+file "/var/lib/logstash/beats.key" do
+  content keys["beats"].join("\n")
   user "root"
   group "logstash"
   mode 0o640
@@ -79,6 +79,16 @@ forwarders.sort_by { |n| n[:fqdn] }.each do |forwarder|
       dest_ports "5043"
       source_ports "1024:"
     end
+
+    firewall_rule "accept-beats-#{forwarder}" do
+      action :accept
+      family interface[:family]
+      source "#{interface[:zone]}:#{interface[:address]}"
+      dest "fw"
+      proto "tcp:syn"
+      dest_ports "5044"
+      source_ports "1024:"
+    end
   end
 end
 
@@ -95,5 +105,15 @@ gateways.sort_by { |n| n[:fqdn] }.each do |gateway|
       dest_ports "5043"
       source_ports "1024:"
     end
+
+    firewall_rule "accept-beats-#{gateway}" do
+      action :accept
+      family interface[:family]
+      source "#{interface[:zone]}:#{interface[:address]}"
+      dest "fw"
+      proto "tcp:syn"
+      dest_ports "5044"
+      source_ports "1024:"
+    end
   end
 end