mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-11-29 06:00:19 +01:00
Merge pull request #57 from willshersystems/ansible23_fixes
Ansible23 fixes
This commit is contained in:
commit
7009c82b50
4 changed files with 5 additions and 15 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
.vagrant
|
.vagrant
|
||||||
tests/roles/ansible-sshd
|
tests/roles/ansible-sshd
|
||||||
|
tests/test.retry
|
||||||
|
|
|
@ -4,11 +4,9 @@
|
||||||
sshd_skip_defaults: false
|
sshd_skip_defaults: false
|
||||||
# If the below is false, don't manage the service or reload the SSH
|
# If the below is false, don't manage the service or reload the SSH
|
||||||
# daemon at all
|
# daemon at all
|
||||||
sshd_manage_service: "{{ false if ansible_virtualization_type == 'docker' else true }}"
|
sshd_manage_service: true
|
||||||
# If the below is false, don't reload the ssh deamon on change
|
# If the below is false, don't reload the ssh deamon on change
|
||||||
sshd_allow_reload: "{{ sshd_manage_service }}"
|
sshd_allow_reload: true
|
||||||
# If the below is false, don't manage /var/run/sshd directory
|
|
||||||
sshd_manage_var_run: "{{ false if ansible_os_family == 'Archlinux' or (ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7') else true }}"
|
|
||||||
# Empty dicts to avoid errors
|
# Empty dicts to avoid errors
|
||||||
sshd: {}
|
sshd: {}
|
||||||
|
|
||||||
|
|
|
@ -3,4 +3,4 @@
|
||||||
service:
|
service:
|
||||||
name: "{{ sshd_service }}"
|
name: "{{ sshd_service }}"
|
||||||
state: reloaded
|
state: reloaded
|
||||||
when: sshd_allow_reload
|
when: sshd_allow_reload and ansible_virtualization_type != 'docker'
|
||||||
|
|
|
@ -26,15 +26,6 @@
|
||||||
tags:
|
tags:
|
||||||
- sshd
|
- sshd
|
||||||
|
|
||||||
- name: Run directory
|
|
||||||
file:
|
|
||||||
path: /var/run/sshd
|
|
||||||
state: directory
|
|
||||||
mode: 0755
|
|
||||||
when: sshd_manage_var_run
|
|
||||||
tags:
|
|
||||||
- sshd
|
|
||||||
|
|
||||||
- name: Configuration
|
- name: Configuration
|
||||||
template:
|
template:
|
||||||
src: sshd_config.j2
|
src: sshd_config.j2
|
||||||
|
@ -52,7 +43,7 @@
|
||||||
name: "{{ sshd_service }}"
|
name: "{{ sshd_service }}"
|
||||||
enabled: true
|
enabled: true
|
||||||
state: started
|
state: started
|
||||||
when: sshd_manage_service
|
when: sshd_manage_service and ansible_virtualization_type != 'docker'
|
||||||
tags:
|
tags:
|
||||||
- sshd
|
- sshd
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue