Merge pull request #205 from sscheib/master

This commit is contained in:
Matt Willsher 2022-09-26 08:10:13 +01:00 committed by GitHub
commit 2e2e831c4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 0 deletions

View file

@ -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.

View file

@ -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.
@ -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
vars/OpenWrt.yml Normal file
View file

@ -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