Fix CONDITIONAL_BARE_VARS deprecation warning in ansible 2.8
This commit is contained in:
@ -1,3 +1,3 @@
|
||||
- set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mxisd'] }}"
|
||||
when: "matrix_mxisd_enabled"
|
||||
when: matrix_mxisd_enabled|bool
|
||||
|
@ -3,7 +3,7 @@
|
||||
- always
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup and matrix_mxisd_enabled"
|
||||
when: "run_setup|bool and matrix_mxisd_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-mxisd
|
||||
@ -16,6 +16,6 @@
|
||||
- import_tasks: "{{ role_path }}/tasks/self_check_mxisd.yml"
|
||||
delegate_to: 127.0.0.1
|
||||
become: false
|
||||
when: "run_self_check and matrix_mxisd_enabled"
|
||||
when: "run_self_check|bool and matrix_mxisd_enabled|bool"
|
||||
tags:
|
||||
- self-check
|
||||
|
@ -14,12 +14,12 @@
|
||||
with_items:
|
||||
- "{{ matrix_mxisd_config_path }}"
|
||||
- "{{ matrix_mxisd_data_path }}"
|
||||
when: matrix_mxisd_enabled
|
||||
when: matrix_mxisd_enabled|bool
|
||||
|
||||
- name: Ensure mxisd image is pulled
|
||||
docker_image:
|
||||
name: "{{ matrix_mxisd_docker_image }}"
|
||||
when: matrix_mxisd_enabled
|
||||
when: matrix_mxisd_enabled|bool
|
||||
|
||||
- name: Ensure mxisd config installed
|
||||
copy:
|
||||
@ -28,7 +28,7 @@
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_username }}"
|
||||
when: matrix_mxisd_enabled
|
||||
when: matrix_mxisd_enabled|bool
|
||||
|
||||
- name: Ensure custom templates are installed if any
|
||||
copy:
|
||||
@ -42,7 +42,7 @@
|
||||
- {value: "{{ matrix_mxisd_threepid_medium_email_custom_session_validation_template }}", location: 'validate-template.eml'}
|
||||
- {value: "{{ matrix_mxisd_threepid_medium_email_custom_unbind_fraudulent_template }}", location: 'unbind-fraudulent.eml'}
|
||||
- {value: "{{ matrix_mxisd_threepid_medium_email_custom_matrixid_template }}", location: 'mxid-template.eml'}
|
||||
when: matrix_mxisd_enabled and matrix_mxisd_threepid_medium_email_custom_templates_enabled and item.value
|
||||
when: "matrix_mxisd_enabled|bool and matrix_mxisd_threepid_medium_email_custom_templates_enabled|bool and item.value"
|
||||
|
||||
- name: Ensure matrix-mxisd.service installed
|
||||
template:
|
||||
@ -50,12 +50,12 @@
|
||||
dest: "/etc/systemd/system/matrix-mxisd.service"
|
||||
mode: 0644
|
||||
register: matrix_mxisd_systemd_service_result
|
||||
when: matrix_mxisd_enabled
|
||||
when: matrix_mxisd_enabled|bool
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-mxisd.service installation
|
||||
service:
|
||||
daemon_reload: yes
|
||||
when: "matrix_mxisd_enabled and matrix_mxisd_systemd_service_result.changed"
|
||||
when: "matrix_mxisd_enabled|bool and matrix_mxisd_systemd_service_result.changed"
|
||||
|
||||
#
|
||||
# Tasks related to getting rid of mxisd (if it was previously enabled)
|
||||
@ -72,27 +72,27 @@
|
||||
state: stopped
|
||||
daemon_reload: yes
|
||||
register: stopping_result
|
||||
when: "not matrix_mxisd_enabled and matrix_mxisd_service_stat.stat.exists"
|
||||
when: "not matrix_mxisd_enabled|bool and matrix_mxisd_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-mxisd.service doesn't exist
|
||||
file:
|
||||
path: "/etc/systemd/system/matrix-mxisd.service"
|
||||
state: absent
|
||||
when: "not matrix_mxisd_enabled and matrix_mxisd_service_stat.stat.exists"
|
||||
when: "not matrix_mxisd_enabled|bool and matrix_mxisd_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-mxisd.service removal
|
||||
service:
|
||||
daemon_reload: yes
|
||||
when: "not matrix_mxisd_enabled and matrix_mxisd_service_stat.stat.exists"
|
||||
when: "not matrix_mxisd_enabled|bool and matrix_mxisd_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure Matrix mxisd paths don't exist
|
||||
file:
|
||||
path: "{{ matrix_mxisd_base_path }}"
|
||||
state: absent
|
||||
when: "not matrix_mxisd_enabled"
|
||||
when: "not matrix_mxisd_enabled|bool"
|
||||
|
||||
- name: Ensure mxisd Docker image doesn't exist
|
||||
docker_image:
|
||||
name: "{{ matrix_mxisd_docker_image }}"
|
||||
state: absent
|
||||
when: "not matrix_mxisd_enabled"
|
||||
when: "not matrix_mxisd_enabled|bool"
|
||||
|
Reference in New Issue
Block a user