1
0
mirror of https://github.com/spantaleev/matrix-docker-ansible-deploy.git synced 2024-12-12 08:43:55 +02:00
matrix-docker-ansible-deploy/roles/matrix-client-element/tasks/migrate_riot_web.yml

38 lines
1.4 KiB
YAML
Raw Normal View History

---
- name: Check existence of matrix-riot-web.service
2022-07-18 10:22:05 +02:00
ansible.builtin.stat:
path: "{{ matrix_systemd_path }}/matrix-riot-web.service"
register: matrix_client_riot_web_service_stat
2022-07-18 10:22:05 +02:00
when: "matrix_client_element_enabled | bool"
- name: Ensure matrix-riot-web is stopped
ansible.builtin.service:
name: matrix-riot-web
state: stopped
enabled: false
daemon_reload: true
register: stopping_result
2022-07-18 10:22:05 +02:00
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
2022-07-18 10:22:05 +02:00
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
2022-07-18 10:22:05 +02:00
when: "matrix_client_element_enabled | bool and matrix_client_riot_web_service_stat.stat.exists"
- name: Check existence of /matrix/riot-web
2022-07-18 10:22:05 +02:00
ansible.builtin.stat:
path: "/matrix/riot-web"
register: matrix_client_riot_web_dir_stat
2022-07-18 10:22:05 +02:00
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"
2022-07-18 10:22:05 +02:00
when: "matrix_client_element_enabled | bool and matrix_client_riot_web_dir_stat.stat.exists"