Fix CONDITIONAL_BARE_VARS deprecation warning in ansible 2.8

This commit is contained in:
Dan Arnfield
2019-05-21 10:25:59 -05:00
parent affb99003c
commit 3982f114af
61 changed files with 224 additions and 226 deletions

View File

@ -1,3 +1,3 @@
- set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-riot-web'] }}"
when: matrix_riot_web_enabled
when: matrix_riot_web_enabled|bool

View File

@ -3,13 +3,13 @@
- always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup and matrix_riot_web_enabled"
when: "run_setup|bool and matrix_riot_web_enabled|bool"
tags:
- setup-all
- setup-riot-web
- import_tasks: "{{ role_path }}/tasks/setup_riot_web.yml"
when: run_setup
when: run_setup|bool
tags:
- setup-all
- setup-riot-web
@ -17,6 +17,6 @@
- import_tasks: "{{ role_path }}/tasks/self_check_riot_web.yml"
delegate_to: 127.0.0.1
become: false
when: "run_self_check and matrix_riot_web_enabled"
when: "run_self_check|bool and matrix_riot_web_enabled|bool"
tags:
- self-check
- self-check

View File

@ -11,12 +11,12 @@
mode: 0750
owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_username }}"
when: matrix_riot_web_enabled
when: matrix_riot_web_enabled|bool
- name: Ensure riot-web Docker image is pulled
docker_image:
name: "{{ matrix_riot_web_docker_image }}"
when: matrix_riot_web_enabled
when: matrix_riot_web_enabled|bool
- name: Ensure Matrix riot-web config files installed
template:
@ -30,7 +30,7 @@
- {src: "{{ role_path }}/templates/nginx.conf.j2", name: "nginx.conf"}
- {src: "{{ role_path }}/templates/welcome.html.j2", name: "welcome.html"}
- {src: "{{ matrix_riot_web_embedded_pages_home_path }}", name: "home.html"}
when: "matrix_riot_web_enabled and item.src is not none"
when: "matrix_riot_web_enabled|bool and item.src is not none"
- name: Ensure Matrix riot-web config files removed
file:
@ -38,7 +38,7 @@
state: absent
with_items:
- {src: "{{ matrix_riot_web_embedded_pages_home_path }}", name: "home.html"}
when: "matrix_riot_web_enabled and item.src is none"
when: "matrix_riot_web_enabled|bool and item.src is none"
- name: Ensure matrix-riot-web.service installed
template:
@ -46,7 +46,7 @@
dest: "/etc/systemd/system/matrix-riot-web.service"
mode: 0644
register: matrix_riot_web_systemd_service_result
when: matrix_riot_web_enabled
when: matrix_riot_web_enabled|bool
- name: Ensure systemd reloaded after matrix-riot-web.service installation
service:
@ -61,7 +61,7 @@
stat:
path: "/etc/systemd/system/matrix-riot-web.service"
register: matrix_riot_web_service_stat
when: "not matrix_riot_web_enabled"
when: "not matrix_riot_web_enabled|bool"
- name: Ensure matrix-riot-web is stopped
service:
@ -69,27 +69,27 @@
state: stopped
daemon_reload: yes
register: stopping_result
when: "not matrix_riot_web_enabled and matrix_riot_web_service_stat.stat.exists"
when: "not matrix_riot_web_enabled|bool and matrix_riot_web_service_stat.stat.exists"
- name: Ensure matrix-riot-web.service doesn't exist
file:
path: "/etc/systemd/system/matrix-riot-web.service"
state: absent
when: "not matrix_riot_web_enabled and matrix_riot_web_service_stat.stat.exists"
when: "not matrix_riot_web_enabled|bool and matrix_riot_web_service_stat.stat.exists"
- name: Ensure systemd reloaded after matrix-riot-web.service removal
service:
daemon_reload: yes
when: "not matrix_riot_web_enabled and matrix_riot_web_service_stat.stat.exists"
when: "not matrix_riot_web_enabled|bool and matrix_riot_web_service_stat.stat.exists"
- name: Ensure Matrix riot-web paths doesn't exist
file:
path: "{{ matrix_riot_web_data_path }}"
state: absent
when: "not matrix_riot_web_enabled"
when: "not matrix_riot_web_enabled|bool"
- name: Ensure riot-web Docker image doesn't exist
docker_image:
name: "{{ matrix_riot_web_docker_image }}"
state: absent
when: "not matrix_riot_web_enabled"
when: "not matrix_riot_web_enabled|bool"