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:
jitakirin 2015-06-26 11:38:09 +01:00
parent 4a5678f93e
commit d0b2b029a1
2 changed files with 2 additions and 5 deletions

View file

@ -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 }}"

View file

@ -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