Skip to content

Commit

Permalink
Merge pull request #205 from sscheib/master
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwillsher authored Sep 26, 2022
2 parents 2da40a9 + 6819be9 commit 2e2e831
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Tested on:
* FreeBSD 10.1
* OpenBSD 6.0
* AIX 7.1, 7.2
* OpenWrt 21.03

It will likely work on other flavours and more direct support via suitable
[vars/](vars/) files is welcome.
Expand Down
11 changes: 11 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- ansible_virtualization_type|default(None) not in __sshd_skip_virt_env
- ansible_connection != 'chroot'
- ansible_os_family != 'AIX'
- ansible_os_family != 'OpenWrt'
listen: reload_sshd

# sshd on AIX cannot be 'reloaded', it must be Stopped+Started.
Expand All @@ -29,3 +30,13 @@
when:
- sshd_allow_reload|bool
- ansible_os_family == 'AIX'

# sshd on OpenWrt does not support reloading a service, it has to be restarted instead
- name: Reload the SSH service (OpenWrt)
ansible.builtin.service:
name: "{{ sshd_service }}"
state: restarted
when:
- sshd_allow_reload|bool
- ansible_os_family == 'OpenWrt'
listen: reload_sshd
14 changes: 14 additions & 0 deletions vars/OpenWrt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
__sshd_service: sshd
__sshd_packages:
- openssh-server
- openssh-sftp-server
__sshd_config_mode: "0644"
__sshd_sftp_server: "/usr/lib/sftp-server"
__sshd_defaults:
Subsystem: "sftp {{ __sshd_sftp_server }}"
AuthorizedKeysFile: .ssh/authorized_keys
HostKey:
- /etc/ssh/ssh_host_rsa_key
- /etc/ssh/ssh_host_ed25519_key
__sshd_os_supported: yes

0 comments on commit 2e2e831

Please sign in to comment.