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