Fix rights for sshd_config

master
Oleg Vasilev 2021-12-28 00:02:10 +03:00
parent 78d0ad0abf
commit a201bd83b7
3 changed files with 22 additions and 6 deletions

View File

@ -1,12 +1,15 @@
--- ---
- name: sshd | Setup sshd_config - name: unbound | Load system-specific vars
include_vars: "{{ ansible_system | lower }}.yml"
- name: sshd | Deploy sshd_config
template: template:
src: "{{ sshd_config_template }}" src: "{{ sshd_config_template }}"
dest: /etc/ssh/sshd_config dest: /etc/ssh/sshd_config
mode: 0640 mode: "{{ sshd_config_props.mode }}"
owner: root owner: "{{ sshd_config_props.owner }}"
group: root group: "{{ sshd_config_props.group }}"
validate: sshd -t -f %s validate: sshd -t -f %s
notify: sshd | Apply config notify: sshd | Apply config

6
vars/linux.yml Normal file
View File

@ -0,0 +1,6 @@
---
sshd_config_props:
mode: 0640
owner: root
group: root

7
vars/openbsd.yml Normal file
View File

@ -0,0 +1,7 @@
---
sshd_config_props:
mode: 0644
owner: root
group: wheel