Bedingter Restart raus
This commit is contained in:
parent
6f93842670
commit
024d0225e4
|
@ -2,10 +2,9 @@
|
|||
- name: "Set «PermitRootLogin» to «without-password»"
|
||||
lineinfile:
|
||||
dest: /etc/ssh/sshd_config
|
||||
regexp: '^#? *PermitRootLogin'
|
||||
regexp: '^#* *PermitRootLogin'
|
||||
line: "PermitRootLogin without-password"
|
||||
backup: yes
|
||||
register: sshconfigchanged
|
||||
|
||||
|
||||
- name: Restart sshd
|
||||
|
@ -13,6 +12,5 @@
|
|||
name: "{{ ssh_service_name }}"
|
||||
state: restarted
|
||||
sleep: 5
|
||||
when: sshconfigchanged is changed
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue