matrix-docker-ansible-deploy/roles/custom/matrix-coturn/tasks/setup_uninstall.yml

39 lines
1.1 KiB
YAML
Raw Normal View History

---
- name: Check existence of matrix-coturn service
2022-07-18 08:22:05 +00:00
ansible.builtin.stat:
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-coturn.service"
register: matrix_coturn_service_stat
2022-07-18 08:22:05 +00:00
when: "not matrix_coturn_enabled | bool"
- when: matrix_coturn_service_stat.stat.exists | bool
block:
- name: Ensure matrix-coturn is stopped
ansible.builtin.service:
name: matrix-coturn
state: stopped
enabled: false
daemon_reload: true
- name: Ensure matrix-coturn-reload.timer is stopped
ansible.builtin.service:
name: matrix-coturn
state: stopped
enabled: false
daemon_reload: true
failed_when: false
- name: Ensure systemd units don't exist
ansible.builtin.file:
path: "{{ devture_systemd_docker_base_systemd_path }}/{{ item }}"
state: absent
with_items:
- matrix-coturn.service
- matrix-coturn-reload.service
- matrix-coturn-reload.timer
- name: Ensure Matrix coturn paths don't exist
ansible.builtin.file:
path: "{{ matrix_coturn_base_path }}"
state: absent