ansible-sshd/handlers/main.yml

26 lines
876 B
YAML
Raw Normal View History

2014-12-18 23:12:51 +01:00
---
2017-09-06 16:20:00 +02:00
- name: Reload the SSH service
2014-12-18 23:12:51 +01:00
service:
name: "{{ sshd_service }}"
state: reloaded
when:
2019-05-23 21:38:31 +02:00
- sshd_allow_reload|bool
- ansible_virtualization_type|default(None) != 'docker'
- ansible_connection != 'chroot'
- ansible_os_family != 'AIX'
2017-09-06 16:20:00 +02:00
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'