added sshd config playbook
This commit is contained in:
9
sshd-config.yml
Normal file
9
sshd-config.yml
Normal 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
tasks/general/sshd-config.yml
Normal file
13
tasks/general/sshd-config.yml
Normal 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
|
||||
Reference in New Issue
Block a user