init
This commit is contained in:
25
ansible/roles/harden/sshd_config/tasks/main.yml
Normal file
25
ansible/roles/harden/sshd_config/tasks/main.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
- name: ensure sshd_config.d directory exists
|
||||
become: true
|
||||
file:
|
||||
path: "/etc/ssh/sshd_config.d"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
|
||||
- name: deploy sshd config file
|
||||
become: true
|
||||
template:
|
||||
src: "00-sshd_config-hardening.conf.j2"
|
||||
dest: "/etc/ssh/sshd_config.d/00-sshd_config-hardening.conf"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
validate: "sshd -t -f %s"
|
||||
|
||||
- name: restart SSH service
|
||||
become: true
|
||||
service:
|
||||
name: ssh
|
||||
state: restarted
|
||||
Reference in New Issue
Block a user