replace sshd.socket with sshd.service

Existing users can delete the old override file:

    rm -r /etc/systemd/system/sshd.socket.d

Closes #92
This commit is contained in:
Pig Monkey 2021-01-31 13:20:16 -08:00
parent f17ff4a672
commit 335729fb2f
3 changed files with 6 additions and 18 deletions

View file

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

View file

@ -8,33 +8,22 @@
template:
src: sshd_config.j2
dest: /etc/ssh/sshd_config
- name: Create OpenSSH systemd unit file directory
file:
path: /etc/systemd/system/sshd.socket.d
state: directory
- 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
name: sshd.service
enabled: yes
state: started
when: ssh.enable_sshd is defined and ssh.enable_sshd == True
- name: Disable and stop OpenSSH
service:
name: sshd.socket
name: sshd.service
enabled: no
state: stopped
when: ssh.enable_sshd is defined and ssh.enable_sshd == True
when: ssh.enable_sshd is defined and ssh.enable_sshd == False
- name: Install sshfs
pacman:

View file

@ -1,3 +0,0 @@
[Socket]
ListenStream=
ListenStream={{ ssh.port }}