mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-11-22 19:10:18 +01:00
Verify SSHd config early
This uses the validate option to check the config file early, which avoids putting bad settings in place at all, and also enables a fail-fast behaviour (errors out when processing the template module).
This commit is contained in:
parent
4a5678f93e
commit
d0b2b029a1
2 changed files with 2 additions and 5 deletions
|
@ -1,8 +1,4 @@
|
||||||
---
|
---
|
||||||
- name: check_and_reload_sshd
|
|
||||||
command: "{{ sshd_binary }} -t"
|
|
||||||
notify: reload_sshd
|
|
||||||
|
|
||||||
- name: reload_sshd
|
- name: reload_sshd
|
||||||
service:
|
service:
|
||||||
name: "{{ sshd_service }}"
|
name: "{{ sshd_service }}"
|
||||||
|
|
|
@ -38,7 +38,8 @@
|
||||||
owner: "{{ sshd_config_owner }}"
|
owner: "{{ sshd_config_owner }}"
|
||||||
group: "{{ sshd_config_group }}"
|
group: "{{ sshd_config_group }}"
|
||||||
mode: "{{ sshd_config_mode }}"
|
mode: "{{ sshd_config_mode }}"
|
||||||
notify: check_and_reload_sshd
|
validate: "{{ sshd_binary }} -t -f %s"
|
||||||
|
notify: reload_sshd
|
||||||
tags:
|
tags:
|
||||||
- sshd
|
- sshd
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue