]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/networking/recipes/default.rb
Configure shared TCP fastopen keys for tile and www
[chef.git] / cookbooks / networking / recipes / default.rb
index f6015a17eb6d692d460236569b68441edf3ca55f..8b6b1f35f64f6a3f7c53585d960c870035e93b25 100644 (file)
@@ -76,6 +76,10 @@ node[:networking][:interfaces].each do |name, interface|
 
     deviceplan["addresses"].push("#{interface[:address]}/#{prefix}")
 
+    if interface[:mtu]
+      deviceplan["mtu"] = interface[:mtu]
+    end
+
     if interface[:bond]
       deviceplan["interfaces"] = interface[:bond][:slaves].to_a
 
@@ -194,6 +198,17 @@ template "/etc/systemd/resolved.conf.d/99-chef.conf" do
   notifies :restart, "service[systemd-resolved]"
 end
 
+if node[:networking][:tcp_fastopen_key]
+  fastopen_keys = data_bag_item("networking", "fastopen")
+
+  node.normal[:sysctl][:tcp_fastopen] = {
+    :comment => "Set shared key for TCP fast open",
+    :parameters => {
+      "net.ipv4.tcp_fastopen_key" => fastopen_keys[node[:networking][:tcp_fastopen_key]]
+    }
+  }
+end
+
 node.interfaces(:role => :internal) do |interface|
   if interface[:gateway] && interface[:gateway] != interface[:address]
     search(:node, "networking_interfaces*address:#{interface[:gateway]}") do |gateway|