add sshd handler

This commit is contained in:
Pig Monkey 2016-01-30 16:05:33 -08:00
parent 2e84ecca61
commit 27064030a3
3 changed files with 10 additions and 0 deletions

View file

@ -0,0 +1,4 @@
---
- name: restart sshd
service: name=sshd.socket state=restarted
when: ssh.enable_sshd == True

3
roles/ssh/meta/main.yml Normal file
View file

@ -0,0 +1,3 @@
---
dependencies:
- { role: systemd }

View file

@ -10,6 +10,9 @@
- name: Push OpenSSH socket unit file
template: src=sshd-socket-override.conf.j2 dest=/etc/systemd/system/sshd.socket.d/override.conf
notify:
- reload systemd config
- restart sshd
- name: Enable and start OpenSSH
service: name=sshd.socket enabled=yes state=started