2022-04-21 10:07:47 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Check existence of matrix-matrix-registration-bot service
|
2022-07-18 10:22:05 +02:00
|
|
|
ansible.builtin.stat:
|
2022-11-04 16:38:38 +02:00
|
|
|
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-matrix-registration-bot.service"
|
2022-04-21 10:07:47 +02:00
|
|
|
register: matrix_bot_matrix_registration_bot_service_stat
|
|
|
|
|
|
|
|
- name: Ensure matrix-matrix-registration-bot is stopped
|
2022-07-18 09:39:08 +02:00
|
|
|
ansible.builtin.service:
|
2022-04-21 10:07:47 +02:00
|
|
|
name: matrix-bot-matrix-registration-bot
|
|
|
|
state: stopped
|
|
|
|
enabled: false
|
|
|
|
daemon_reload: true
|
|
|
|
register: stopping_result
|
2022-07-18 10:22:05 +02:00
|
|
|
when: "matrix_bot_matrix_registration_bot_service_stat.stat.exists | bool"
|
2022-04-21 10:07:47 +02:00
|
|
|
|
|
|
|
- name: Ensure matrix-bot-matrix-registration-bot.service doesn't exist
|
2022-07-18 09:39:08 +02:00
|
|
|
ansible.builtin.file:
|
2022-11-04 16:38:38 +02:00
|
|
|
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-matrix-registration-bot.service"
|
2022-04-21 10:07:47 +02:00
|
|
|
state: absent
|
2022-07-18 10:22:05 +02:00
|
|
|
when: "matrix_bot_matrix_registration_bot_service_stat.stat.exists | bool"
|
2022-04-21 10:07:47 +02:00
|
|
|
|
|
|
|
- name: Ensure systemd reloaded after matrix-bot-matrix-registration-bot.service removal
|
2022-07-18 09:39:08 +02:00
|
|
|
ansible.builtin.service:
|
2022-04-21 10:07:47 +02:00
|
|
|
daemon_reload: true
|
2022-07-18 10:22:05 +02:00
|
|
|
when: "matrix_bot_matrix_registration_bot_service_stat.stat.exists | bool"
|
2022-04-21 10:07:47 +02:00
|
|
|
|
|
|
|
- name: Ensure Matrix matrix-registration-bot paths don't exist
|
2022-07-18 09:39:08 +02:00
|
|
|
ansible.builtin.file:
|
2022-04-21 10:07:47 +02:00
|
|
|
path: "{{ matrix_bot_matrix_registration_bot_base_path }}"
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: Ensure matrix-registration-bot Docker image doesn't exist
|
2022-10-28 13:20:17 +02:00
|
|
|
community.docker.docker_image:
|
2022-04-21 10:07:47 +02:00
|
|
|
name: "{{ matrix_bot_matrix_registration_bot_docker_image }}"
|
|
|
|
state: absent
|