mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-09-19 23:11:32 +02:00
Merge pull request #112 from d-little/aix-support
AIX support (including new AIX handler)
This commit is contained in:
commit
a9354934ee
4 changed files with 39 additions and 3 deletions
10
README.md
10
README.md
|
@ -34,6 +34,7 @@ Tested on:
|
||||||
* EL 6,7 derived distributions
|
* EL 6,7 derived distributions
|
||||||
* Fedora 22, 23
|
* Fedora 22, 23
|
||||||
* OpenBSD 6.0
|
* OpenBSD 6.0
|
||||||
|
* AIX 7.1, 7.2
|
||||||
|
|
||||||
It will likely work on other flavours and more direct support via suitable
|
It will likely work on other flavours and more direct support via suitable
|
||||||
[vars/](vars/) files is welcome.
|
[vars/](vars/) files is welcome.
|
||||||
|
@ -58,14 +59,17 @@ variables. Defaults to *False*.
|
||||||
|
|
||||||
If set to False, the service/daemon won't be **managed** at all, i.e. will not
|
If set to False, the service/daemon won't be **managed** at all, i.e. will not
|
||||||
try to enable on boot or start or reload the service. Defaults to *True*
|
try to enable on boot or start or reload the service. Defaults to *True*
|
||||||
unless running inside a docker container (it is assumed ansible is used during
|
unless: Running inside a docker container (it is assumed ansible is used during
|
||||||
build phase).
|
build phase) or AIX (Ansible `service` module does not currently support `enabled`
|
||||||
|
for AIX)
|
||||||
|
|
||||||
* `sshd_allow_reload`
|
* `sshd_allow_reload`
|
||||||
|
|
||||||
If set to False, a reload of sshd wont happen on change. This can help with
|
If set to False, a reload of sshd wont happen on change. This can help with
|
||||||
troubleshooting. You'll need to manually reload sshd if you want to apply the
|
troubleshooting. You'll need to manually reload sshd if you want to apply the
|
||||||
changed configuration. Defaults to the same value as ``sshd_manage_service``.
|
changed configuration. Defaults to the same value as ``sshd_manage_service``.
|
||||||
|
(Except on AIX, where `sshd_manage_service` is default *False*, but
|
||||||
|
`sshd_allow_reload` is default *True*)
|
||||||
|
|
||||||
* `sshd_install_service`
|
* `sshd_install_service`
|
||||||
|
|
||||||
|
|
|
@ -8,4 +8,19 @@
|
||||||
- sshd_allow_reload|bool
|
- sshd_allow_reload|bool
|
||||||
- ansible_virtualization_type|default(None) != 'docker'
|
- ansible_virtualization_type|default(None) != 'docker'
|
||||||
- ansible_connection != 'chroot'
|
- ansible_connection != 'chroot'
|
||||||
|
- ansible_os_family != 'AIX'
|
||||||
listen: reload_sshd
|
listen: reload_sshd
|
||||||
|
|
||||||
|
# sshd on AIX cannot be 'reloaded', it must be Stopped+Started.
|
||||||
|
# It's dangerous to do this in two tasks.. you're stopping SSH and then trying to SSH back in to start it.
|
||||||
|
# Instead, use a dirty shell script:
|
||||||
|
# https://www.ibm.com/developerworks/community/blogs/brian/entry/scripting_the_stop_and_restart_of_src_controlled_processes_on_aix6
|
||||||
|
- name: Reload sshd Service (AIX)
|
||||||
|
shell: |
|
||||||
|
stopsrc -s sshd
|
||||||
|
until $(lssrc -s sshd | grep -q inoperative); do sleep 1; done
|
||||||
|
startsrc -s sshd
|
||||||
|
listen: reload_sshd
|
||||||
|
when:
|
||||||
|
- sshd_allow_reload|bool
|
||||||
|
- ansible_os_family == 'AIX'
|
||||||
|
|
|
@ -29,6 +29,10 @@ galaxy_info:
|
||||||
- name: OpenBSD
|
- name: OpenBSD
|
||||||
versions:
|
versions:
|
||||||
- 6.0
|
- 6.0
|
||||||
|
- name: AIX
|
||||||
|
versions:
|
||||||
|
- 7.1
|
||||||
|
- 7.2
|
||||||
galaxy_tags:
|
galaxy_tags:
|
||||||
- networking
|
- networking
|
||||||
- system
|
- system
|
||||||
|
@ -42,4 +46,5 @@ galaxy_info:
|
||||||
- redhat
|
- redhat
|
||||||
- freebsd
|
- freebsd
|
||||||
- openbsd
|
- openbsd
|
||||||
|
- aix
|
||||||
dependencies: []
|
dependencies: []
|
||||||
|
|
12
vars/AIX.yml
Normal file
12
vars/AIX.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
---
|
||||||
|
__sshd_config_mode: '0644'
|
||||||
|
__sshd_packages: [ ] # sshd is not installed by yum / AIX toolbox for Linux. You'll need to manually install them using AIX Web Download Packs.
|
||||||
|
__sshd_sftp_server: /usr/sbin/sftp-server
|
||||||
|
__sshd_config_group: system
|
||||||
|
__sshd_defaults:
|
||||||
|
Subsystem: "sftp {{ sshd_sftp_server }}"
|
||||||
|
__sshd_os_supported: yes
|
||||||
|
|
||||||
|
sshd_install_service: no
|
||||||
|
sshd_manage_service: no
|
||||||
|
sshd_allow_reload: yes
|
Loading…
Reference in a new issue