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"
|
line: "CertificateFile /etc/ssh/{{ item.name }}-cert.pub"
|
||||||
create: true
|
create: true
|
||||||
when: item.type == "user"
|
when: item.type == "user"
|
||||||
|
notify: restart sshd
|
||||||
|
|
||||||
- name: Enable user identity
|
- name: Enable user identity
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
@ -43,6 +44,7 @@
|
||||||
line: "IdentityFile /etc/ssh/{{ item.name }}"
|
line: "IdentityFile /etc/ssh/{{ item.name }}"
|
||||||
create: true
|
create: true
|
||||||
when: item.type == "user"
|
when: item.type == "user"
|
||||||
|
notify: restart sshd
|
||||||
|
|
||||||
- name: Enable host certificate
|
- name: Enable host certificate
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
@ -50,6 +52,7 @@
|
||||||
line: "HostCertificate /etc/ssh/{{ item.name }}-cert.pub"
|
line: "HostCertificate /etc/ssh/{{ item.name }}-cert.pub"
|
||||||
create: true
|
create: true
|
||||||
when: item.type == "host"
|
when: item.type == "host"
|
||||||
|
notify: restart sshd
|
||||||
|
|
||||||
- name: Enable host key
|
- name: Enable host key
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
@ -57,3 +60,4 @@
|
||||||
line: "HostKey /etc/ssh/{{ item.name }}"
|
line: "HostKey /etc/ssh/{{ item.name }}"
|
||||||
create: true
|
create: true
|
||||||
when: item.type == "host"
|
when: item.type == "host"
|
||||||
|
notify: restart sshd
|
||||||
|
|
Reference in a new issue