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-corporal'] }}"
|
||||
when: "matrix_corporal_enabled"
|
||||
when: matrix_corporal_enabled|bool
|
||||
|
@ -3,13 +3,13 @@
|
||||
- always
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup and matrix_corporal_enabled"
|
||||
when: "run_setup|bool and matrix_corporal_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-corporal
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_corporal.yml"
|
||||
when: run_setup
|
||||
when: run_setup|bool
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-corporal
|
||||
@ -17,6 +17,6 @@
|
||||
- import_tasks: "{{ role_path }}/tasks/self_check_corporal.yml"
|
||||
delegate_to: 127.0.0.1
|
||||
become: false
|
||||
when: "run_self_check and matrix_corporal_enabled"
|
||||
when: "run_self_check|bool and matrix_corporal_enabled|bool"
|
||||
tags:
|
||||
- self-check
|
||||
- self-check
|
||||
|
@ -15,19 +15,19 @@
|
||||
- "{{ matrix_corporal_config_dir_path }}"
|
||||
- "{{ matrix_corporal_cache_dir_path }}"
|
||||
- "{{ matrix_corporal_var_dir_path }}"
|
||||
when: "matrix_corporal_enabled"
|
||||
when: matrix_corporal_enabled|bool
|
||||
|
||||
- name: Ensure Matrix Corporal Docker image is pulled
|
||||
docker_image:
|
||||
name: "{{ matrix_corporal_docker_image }}"
|
||||
when: "matrix_corporal_enabled"
|
||||
when: matrix_corporal_enabled|bool
|
||||
|
||||
- name: Ensure Matrix Corporal config installed
|
||||
template:
|
||||
src: "{{ role_path }}/templates/config.json.j2"
|
||||
dest: "{{ matrix_corporal_config_dir_path }}/config.json"
|
||||
mode: 0644
|
||||
when: "matrix_corporal_enabled"
|
||||
when: matrix_corporal_enabled|bool
|
||||
|
||||
- name: Ensure matrix-corporal.service installed
|
||||
template:
|
||||
@ -35,12 +35,12 @@
|
||||
dest: "/etc/systemd/system/matrix-corporal.service"
|
||||
mode: 0644
|
||||
register: matrix_corporal_systemd_service_result
|
||||
when: "matrix_corporal_enabled"
|
||||
when: matrix_corporal_enabled|bool
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-corporal.service installation
|
||||
service:
|
||||
daemon_reload: yes
|
||||
when: "matrix_corporal_enabled and matrix_corporal_systemd_service_result.changed"
|
||||
when: "matrix_corporal_enabled|bool and matrix_corporal_systemd_service_result.changed"
|
||||
|
||||
|
||||
#
|
||||
@ -51,7 +51,7 @@
|
||||
stat:
|
||||
path: "/etc/systemd/system/matrix-corporal.service"
|
||||
register: matrix_corporal_service_stat
|
||||
when: "not matrix_corporal_enabled"
|
||||
when: "not matrix_corporal_enabled|bool"
|
||||
|
||||
- name: Ensure matrix-corporal is stopped
|
||||
service:
|
||||
@ -59,18 +59,18 @@
|
||||
state: stopped
|
||||
daemon_reload: yes
|
||||
register: stopping_result
|
||||
when: "not matrix_corporal_enabled and matrix_corporal_service_stat.stat.exists"
|
||||
when: "not matrix_corporal_enabled|bool and matrix_corporal_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-corporal.service doesn't exist
|
||||
file:
|
||||
path: "/etc/systemd/system/matrix-corporal.service"
|
||||
state: absent
|
||||
when: "not matrix_corporal_enabled and matrix_corporal_service_stat.stat.exists"
|
||||
when: "not matrix_corporal_enabled|bool and matrix_corporal_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-corporal.service removal
|
||||
service:
|
||||
daemon_reload: yes
|
||||
when: "not matrix_corporal_enabled and matrix_corporal_service_stat.stat.exists"
|
||||
when: "not matrix_corporal_enabled|bool and matrix_corporal_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-corporal files don't exist
|
||||
file:
|
||||
@ -79,10 +79,10 @@
|
||||
with_items:
|
||||
- /etc/systemd/system/matrix-corporal.service
|
||||
- "{{ matrix_corporal_config_dir_path }}/config.json"
|
||||
when: "not matrix_corporal_enabled"
|
||||
when: "not matrix_corporal_enabled|bool"
|
||||
|
||||
- name: Ensure Matrix Corporal Docker image doesn't exist
|
||||
docker_image:
|
||||
name: "{{ matrix_corporal_docker_image }}"
|
||||
state: absent
|
||||
when: "not matrix_corporal_enabled"
|
||||
when: "not matrix_corporal_enabled|bool"
|
||||
|
@ -14,4 +14,4 @@
|
||||
- name: Fail if HTTP API enabled, but no token set
|
||||
fail:
|
||||
msg: "The Matrix Corporal HTTP API is enabled (`matrix_corporal_http_api_enabled`), but no auth token has been set in `matrix_corporal_http_api_auth_token`"
|
||||
when: "matrix_corporal_http_api_enabled and matrix_corporal_http_api_auth_token == ''"
|
||||
when: "matrix_corporal_http_api_enabled|bool and matrix_corporal_http_api_auth_token == ''"
|
||||
|
Reference in New Issue
Block a user