You've already forked base
ssh - reload only if config changed
This commit is contained in:
+6
-1
@@ -5,6 +5,7 @@
|
||||
mode: '0644'
|
||||
validate: /usr/sbin/sshd -t -f %s
|
||||
when: ssh_root_authorized_ips is defined
|
||||
register: sshd_conf_changes
|
||||
|
||||
- name: SSH | configure root authorized keys
|
||||
template:
|
||||
@@ -19,9 +20,13 @@
|
||||
command: /usr/sbin/sshd -t
|
||||
register: sshd_config_check
|
||||
changed_when: false
|
||||
when: sshd_conf_changes.changed
|
||||
|
||||
- name: SSH | reload SSH service
|
||||
service:
|
||||
name: ssh
|
||||
state: reloaded
|
||||
when: sshd_config_check.rc == 0
|
||||
when:
|
||||
- sshd_conf_changes.changed
|
||||
- sshd_config_check.rc == 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user