restart sshd if needed
This commit is contained in:
parent
96bc6e97c0
commit
65ea776c21
2 changed files with 8 additions and 0 deletions
4
handlers/main.yml
Normal file
4
handlers/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
- name: restart sshd
|
||||
systemd:
|
||||
name: sshd
|
||||
state: restarted
|
|
@ -36,6 +36,7 @@
|
|||
line: "CertificateFile /etc/ssh/{{ item.name }}-cert.pub"
|
||||
create: true
|
||||
when: item.type == "user"
|
||||
notify: restart sshd
|
||||
|
||||
- name: Enable user identity
|
||||
lineinfile:
|
||||
|
@ -43,6 +44,7 @@
|
|||
line: "IdentityFile /etc/ssh/{{ item.name }}"
|
||||
create: true
|
||||
when: item.type == "user"
|
||||
notify: restart sshd
|
||||
|
||||
- name: Enable host certificate
|
||||
lineinfile:
|
||||
|
@ -50,6 +52,7 @@
|
|||
line: "HostCertificate /etc/ssh/{{ item.name }}-cert.pub"
|
||||
create: true
|
||||
when: item.type == "host"
|
||||
notify: restart sshd
|
||||
|
||||
- name: Enable host key
|
||||
lineinfile:
|
||||
|
@ -57,3 +60,4 @@
|
|||
line: "HostKey /etc/ssh/{{ item.name }}"
|
||||
create: true
|
||||
when: item.type == "host"
|
||||
notify: restart sshd
|
||||
|
|
Reference in a new issue