mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-11-25 20:40:18 +01:00
Fix for ansible_virtualization_type not defined in Ansible > 2.5
ansible_virtualization_type is undefined in Ansible > 2.5 when no virtualization is used. A jinja2 filter has been added that provides a default value (None) so that the check does not fail
This commit is contained in:
parent
77768eb9f4
commit
a257ae7317
2 changed files with 2 additions and 2 deletions
|
@ -3,5 +3,5 @@
|
||||||
service:
|
service:
|
||||||
name: "{{ sshd_service }}"
|
name: "{{ sshd_service }}"
|
||||||
state: reloaded
|
state: reloaded
|
||||||
when: sshd_allow_reload and ansible_virtualization_type != 'docker'
|
when: "sshd_allow_reload and ansible_virtualization_type|default(None) != 'docker'"
|
||||||
listen: reload_sshd
|
listen: reload_sshd
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
name: "{{ sshd_service }}"
|
name: "{{ sshd_service }}"
|
||||||
enabled: true
|
enabled: true
|
||||||
state: started
|
state: started
|
||||||
when: sshd_manage_service and ansible_virtualization_type != 'docker'
|
when: "sshd_manage_service and ansible_virtualization_type|default(None) != 'docker'"
|
||||||
|
|
||||||
- name: Register that this role has run
|
- name: Register that this role has run
|
||||||
set_fact: sshd_has_run=true
|
set_fact: sshd_has_run=true
|
||||||
|
|
Loading…
Reference in a new issue