added sshd config playbook

This commit is contained in:
bryanpedini committed 2025-01-31 16:20:07 +01:00
1 parent 15a48010b1
commit 19d725a920
2 files changed
+22

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
---
- hosts: all
become: true
tasks:
- import_tasks: tasks/general/sshd-config.yml
- import_tasks: tasks/debian-general/restart-ssh-service.yml
when: ansible_facts["os_family"] == "Debian"
- import_tasks: tasks/rhel-general/restart-ssh-service.yml
when: ansible_facts["os_family"] == "RedHat"
+13
View File
@@ -0,0 +1,13 @@
---
- name: Ensure the TCPKeepAlive option is uncommented and set to yes
ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config
regexp: "^#?TCPKeepAlive"
line: "TCPKeepAlive yes"
state: present
- name: Ensure the ClientAliveInterval option is uncommented and set to 10 seconds
ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config
regexp: "^#?ClientAliveInterval"
line: "ClientAliveInterval 10"
state: present