Fix matrix_ma1sd_service_stat.stat.exists sometimes being undefined

This commit is contained in:
Slavi Pantaleev 2020-04-03 13:55:23 +03:00
parent c3efd2966f
commit 5927ed56b0

View File

@ -18,14 +18,13 @@
stat:
path: "{{ matrix_systemd_path }}/matrix-mxisd.service"
register: matrix_mxisd_service_stat
when: "ma1sd_migrate_mxisd_data_dir_stat.stat.exists"
- name: Ensure matrix-mxisd is stopped
service:
name: matrix-mxisd
state: stopped
daemon_reload: yes
when: "ma1sd_migrate_mxisd_data_dir_stat.stat.exists and matrix_mxisd_service_stat.stat.exists"
when: "matrix_mxisd_service_stat.stat.exists"
- name: Check existence of matrix-ma1sd service
stat:
@ -63,11 +62,11 @@
file:
path: "{{ matrix_systemd_path }}/matrix-mxisd.service"
state: absent
when: "matrix_ma1sd_service_stat.stat.exists"
when: "matrix_mxisd_service_stat.stat.exists"
- name: Ensure systemd reloaded after removing outdated matrix-mxisd.service
service:
daemon_reload: yes
when: "matrix_ma1sd_service_stat.stat.exists"
when: "matrix_mxisd_service_stat.stat.exists"