From 0460d21a4a07e884912f22b0a3e9cfa43f7e32e6 Mon Sep 17 00:00:00 2001 From: Jason Cameron Date: Tue, 1 Oct 2024 00:35:32 -0400 Subject: [PATCH] feat: Tune TCP keepalive settings for improved connection stability This commit adjusts the TCP keepalive parameters to enhance connection stability and prevent silent failures. Signed-off-by: Jason Cameron --- automation/playbooks/tasks/networking.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/automation/playbooks/tasks/networking.yml b/automation/playbooks/tasks/networking.yml index 78dbedc..0630c6f 100644 --- a/automation/playbooks/tasks/networking.yml +++ b/automation/playbooks/tasks/networking.yml @@ -111,4 +111,16 @@ - name: UFW - enable and by default drop ufw: state: enabled - default: deny \ No newline at end of file + default: deny + + +- name: Set TCP keepalive parameters + ansible.builtin.sysctl: + name: "{{ item.name }}" + value: "{{ item.value }}" + state: present + reload: yes + loop: + - { name: "net.ipv4.tcp_keepalive_time", value: "600" } + - { name: "net.ipv4.tcp_keepalive_intvl", value: "30" } + - { name: "net.ipv4.tcp_keepalive_probes", value: "10" } \ No newline at end of file