More ansible-lint fixes
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-client-element.service'] }}"
|
||||
when: matrix_client_element_enabled|bool
|
||||
when: matrix_client_element_enabled | bool
|
||||
|
||||
# See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070
|
||||
# and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407
|
||||
|
@ -1,42 +1,42 @@
|
||||
---
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup|bool and matrix_client_element_enabled|bool"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_client_element_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-client-element
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/prepare_themes.yml"
|
||||
when: run_setup|bool
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/prepare_themes.yml"
|
||||
when: run_setup | bool
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-client-element
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/migrate_riot_web.yml"
|
||||
when: run_setup|bool
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/migrate_riot_web.yml"
|
||||
when: run_setup | bool
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-client-element
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup|bool and matrix_client_element_enabled|bool"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_client_element_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-client-element
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup|bool and not matrix_client_element_enabled|bool"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_client_element_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-client-element
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/self_check.yml"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/self_check.yml"
|
||||
delegate_to: 127.0.0.1
|
||||
become: false
|
||||
when: "run_self_check|bool and matrix_client_element_enabled|bool"
|
||||
when: "run_self_check | bool and matrix_client_element_enabled | bool"
|
||||
tags:
|
||||
- self-check
|
||||
|
@ -1,10 +1,10 @@
|
||||
---
|
||||
|
||||
- name: Check existence of matrix-riot-web.service
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_systemd_path }}/matrix-riot-web.service"
|
||||
register: matrix_client_riot_web_service_stat
|
||||
when: "matrix_client_element_enabled|bool"
|
||||
when: "matrix_client_element_enabled | bool"
|
||||
|
||||
- name: Ensure matrix-riot-web is stopped
|
||||
ansible.builtin.service:
|
||||
@ -13,25 +13,25 @@
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
register: stopping_result
|
||||
when: "matrix_client_element_enabled|bool and matrix_client_riot_web_service_stat.stat.exists"
|
||||
when: "matrix_client_element_enabled | bool and matrix_client_riot_web_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-riot-web.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-riot-web.service"
|
||||
state: absent
|
||||
when: "matrix_client_element_enabled|bool and matrix_client_riot_web_service_stat.stat.exists"
|
||||
when: "matrix_client_element_enabled | bool and matrix_client_riot_web_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-riot-web.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_client_element_enabled|bool and matrix_client_riot_web_service_stat.stat.exists"
|
||||
when: "matrix_client_element_enabled | bool and matrix_client_riot_web_service_stat.stat.exists"
|
||||
|
||||
- name: Check existence of /matrix/riot-web
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: "/matrix/riot-web"
|
||||
register: matrix_client_riot_web_dir_stat
|
||||
when: "matrix_client_element_enabled|bool"
|
||||
when: "matrix_client_element_enabled | bool"
|
||||
|
||||
- name: Relocate /matrix/riot-web to /matrix/client-element
|
||||
ansible.builtin.command: "mv /matrix/riot-web /matrix/client-element"
|
||||
when: "matrix_client_element_enabled|bool and matrix_client_riot_web_dir_stat.stat.exists"
|
||||
when: "matrix_client_element_enabled | bool and matrix_client_riot_web_dir_stat.stat.exists"
|
||||
|
@ -11,7 +11,7 @@
|
||||
dest: "{{ role_path }}/files/scratchpad/themes"
|
||||
|
||||
- name: Find all Element theme files
|
||||
find:
|
||||
ansible.builtin.find:
|
||||
paths: "{{ role_path }}/files/scratchpad/themes"
|
||||
patterns: "*.json"
|
||||
recurse: true
|
||||
@ -31,7 +31,7 @@
|
||||
run_once: true
|
||||
delegate_to: 127.0.0.1
|
||||
become: false
|
||||
when: matrix_client_element_themes_enabled|bool
|
||||
when: matrix_client_element_themes_enabled | bool
|
||||
|
||||
|
||||
#
|
||||
@ -45,4 +45,4 @@
|
||||
run_once: true
|
||||
delegate_to: 127.0.0.1
|
||||
become: false
|
||||
when: "not matrix_client_element_themes_enabled|bool"
|
||||
when: "not matrix_client_element_themes_enabled | bool"
|
||||
|
@ -10,7 +10,7 @@
|
||||
with_items:
|
||||
- {path: "{{ matrix_client_element_data_path }}", when: true}
|
||||
- {path: "{{ matrix_client_element_docker_src_files_path }}", when: "{{ matrix_client_element_container_image_self_build }}"}
|
||||
when: "item.when|bool"
|
||||
when: "item.when | bool"
|
||||
|
||||
- name: Ensure Element Docker image is pulled
|
||||
docker_image:
|
||||
@ -18,7 +18,7 @@
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_client_element_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_client_element_docker_image_force_pull }}"
|
||||
when: "not matrix_client_element_container_image_self_build|bool"
|
||||
when: "not matrix_client_element_container_image_self_build | bool"
|
||||
register: result
|
||||
retries: "{{ matrix_container_retries_count }}"
|
||||
delay: "{{ matrix_container_retries_delay }}"
|
||||
@ -33,7 +33,7 @@
|
||||
become: true
|
||||
become_user: "{{ matrix_user_username }}"
|
||||
register: matrix_client_element_git_pull_results
|
||||
when: "matrix_client_element_container_image_self_build|bool"
|
||||
when: "matrix_client_element_container_image_self_build | bool"
|
||||
|
||||
# See:
|
||||
# - https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1357
|
||||
@ -47,7 +47,7 @@
|
||||
owner: root
|
||||
ansible.builtin.group: root
|
||||
mode: '0644'
|
||||
when: "matrix_client_element_container_image_self_build|bool and matrix_client_element_container_image_self_build_low_memory_system_patch_enabled|bool"
|
||||
when: "matrix_client_element_container_image_self_build | bool and matrix_client_element_container_image_self_build_low_memory_system_patch_enabled | bool"
|
||||
|
||||
- name: Ensure Element Docker image is built
|
||||
docker_image:
|
||||
@ -59,7 +59,7 @@
|
||||
dockerfile: Dockerfile
|
||||
path: "{{ matrix_client_element_docker_src_files_path }}"
|
||||
pull: true
|
||||
when: "matrix_client_element_container_image_self_build|bool"
|
||||
when: "matrix_client_element_container_image_self_build | bool"
|
||||
|
||||
- name: Ensure Element configuration installed
|
||||
ansible.builtin.copy:
|
||||
@ -100,4 +100,4 @@
|
||||
- name: Ensure systemd reloaded after matrix-client-element.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_client_element_systemd_service_result.changed|bool"
|
||||
when: "matrix_client_element_systemd_service_result.changed | bool"
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
- name: Check existence of matrix-client-element.service
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_systemd_path }}/matrix-client-element.service"
|
||||
register: matrix_client_element_service_stat
|
||||
|
||||
@ -12,18 +12,18 @@
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
register: stopping_result
|
||||
when: "matrix_client_element_service_stat.stat.exists|bool"
|
||||
when: "matrix_client_element_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure matrix-client-element.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-client-element.service"
|
||||
state: absent
|
||||
when: "matrix_client_element_service_stat.stat.exists|bool"
|
||||
when: "matrix_client_element_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-client-element.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_client_element_service_stat.stat.exists|bool"
|
||||
when: "matrix_client_element_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure Element paths doesn't exist
|
||||
ansible.builtin.file:
|
||||
|
Reference in New Issue
Block a user