Configure shared TCP fastopen keys for tile and www
[chef.git] / cookbooks / networking / recipes / default.rb
index 822f9042f1c0c89929b05e228e05aa679c4b2ed6..8b6b1f35f64f6a3f7c53585d960c870035e93b25 100644 (file)
@@ -198,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|