From a04f6f4e3d641f62bf63aa5b4915cdc21637e70c Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Fri, 25 Nov 2022 17:17:54 +0200 Subject: [PATCH] Optimize uninstall tasks a bit - forego removing Docker images - it's not effective anyway, because it only removes the last version.. which is a drop in the bucket, usually - do not reload systemd - it's none of our business. `--tags=start`, etc., handle this - combine all uninstall tasks under a single block, which only runs if we detect traces (a leftover systemd .service file) of the component. If no such .service is detected, we skip them all. This may lead to incorect cleanup in rare cases, but is good enough for the most part. --- .../tasks/setup_uninstall.yml | 50 +++++---------- .../tasks/setup_uninstall.yml | 43 +++++-------- .../tasks/setup_uninstall.yml | 43 +++++-------- .../tasks/setup_uninstall.yml | 43 +++++-------- .../tasks/setup_uninstall.yml | 43 +++++-------- .../tasks/setup_uninstall.yml | 43 +++++-------- .../tasks/setup_uninstall.yml | 43 +++++-------- .../tasks/setup_uninstall.yml | 43 +++++-------- .../tasks/setup_uninstall.yml | 43 +++++-------- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 11 +--- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 54 +++++++--------- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 27 ++++---- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 29 ++++----- .../tasks/setup_uninstall.yml | 43 +++++-------- .../tasks/setup_uninstall.yml | 43 +++++-------- .../tasks/setup_uninstall.yml | 43 +++++-------- .../tasks/setup_uninstall.yml | 43 +++++-------- .../matrix-conduit/tasks/setup_uninstall.yml | 33 ++++------ .../matrix-corporal/tasks/setup_uninstall.yml | 24 +++---- .../matrix-coturn/tasks/setup_uninstall.yml | 63 ++++++++----------- .../matrix-dendrite/tasks/setup_uninstall.yml | 6 -- .../tasks/setup_uninstall.yml | 43 +++++-------- .../tasks/setup_uninstall.yml | 32 ++++------ .../tasks/setup_uninstall.yml | 43 +++++-------- .../matrix-etherpad/tasks/setup_uninstall.yml | 43 +++++-------- .../matrix-grafana/tasks/setup_uninstall.yml | 1 - .../tasks/setup_jitsi_jicofo_uninstall.yml | 1 - .../tasks/setup_jitsi_jvb_uninstall.yml | 1 - .../tasks/setup_jitsi_prosody_uninstall.yml | 1 - .../tasks/setup_jitsi_web_uninstall.yml | 1 - .../tasks/setup_uninstall.yml | 43 +++++-------- .../matrix-ma1sd/tasks/setup_uninstall.yml | 43 +++++-------- .../matrix-mailer/tasks/setup_uninstall.yml | 18 ++---- .../tasks/setup_nginx_proxy.yml | 1 - .../matrix-ntfy/tasks/setup_uninstall.yml | 43 +++++-------- .../tasks/setup_uninstall.yml | 4 -- .../tasks/setup_uninstall.yml | 5 -- .../tasks/setup_uninstall.yml | 1 - .../tasks/setup_uninstall.yml | 30 ++++----- .../tasks/setup_uninstall.yml | 35 ++++------- .../matrix-sygnal/tasks/setup_uninstall.yml | 43 +++++-------- .../tasks/setup_uninstall.yml | 7 --- .../tasks/setup_uninstall.yml | 13 ++-- .../s3-storage-provider/setup_uninstall.yml | 5 -- .../tasks/goofys/setup_uninstall.yml | 43 +++++-------- .../tasks/synapse/setup_uninstall.yml | 48 +++++--------- 66 files changed, 733 insertions(+), 1208 deletions(-) diff --git a/roles/custom/matrix-backup-borg/tasks/setup_uninstall.yml b/roles/custom/matrix-backup-borg/tasks/setup_uninstall.yml index c4c1028d4..3d8b08ef4 100644 --- a/roles/custom/matrix-backup-borg/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-backup-borg/tasks/setup_uninstall.yml @@ -1,41 +1,25 @@ --- + - name: Check existence of matrix-backup-borg service ansible.builtin.stat: path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-backup-borg.service" register: matrix_backup_borg_service_stat -- name: Ensure matrix-backup-borg is stopped - ansible.builtin.service: - name: matrix-backup-borg - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_backup_borg_service_stat.stat.exists | bool" +- when: matrix_backup_borg_service_stat.stat.exists | bool + block: + - name: Ensure matrix-backup-borg is stopped + ansible.builtin.service: + name: matrix-backup-borg + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-backup-borg.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-backup-borg.service" - state: absent - when: "matrix_backup_borg_service_stat.stat.exists | bool" + - name: Ensure matrix-backup-borg.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-backup-borg.service" + state: absent -- name: Ensure matrix-backup-borg.timer doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-backup-borg.timer" - state: absent - when: "matrix_backup_borg_service_stat.stat.exists | bool" - -- name: Ensure systemd reloaded after matrix-backup-borg.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_backup_borg_service_stat.stat.exists | bool" - -- name: Ensure Matrix borg paths don't exist - ansible.builtin.file: - path: "{{ matrix_backup_borg_base_path }}" - state: absent - -- name: Ensure borg Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_backup_borg_docker_image }}" - state: absent + - name: Ensure matrix-backup-borg.timer doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-backup-borg.timer" + state: absent diff --git a/roles/custom/matrix-bot-buscarron/tasks/setup_uninstall.yml b/roles/custom/matrix-bot-buscarron/tasks/setup_uninstall.yml index cb3333bf2..26d920f48 100644 --- a/roles/custom/matrix-bot-buscarron/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bot-buscarron/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-buscarron.service" register: matrix_bot_buscarron_service_stat -- name: Ensure matrix-buscarron is stopped - ansible.builtin.service: - name: matrix-bot-buscarron - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_bot_buscarron_service_stat.stat.exists | bool" +- when: matrix_bot_buscarron_service_stat.stat.exists | bool + block: + - name: Ensure matrix-buscarron is stopped + ansible.builtin.service: + name: matrix-bot-buscarron + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-bot-buscarron.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-buscarron.service" - state: absent - when: "matrix_bot_buscarron_service_stat.stat.exists | bool" + - name: Ensure matrix-bot-buscarron.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-buscarron.service" + state: absent -- name: Ensure systemd reloaded after matrix-bot-buscarron.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_bot_buscarron_service_stat.stat.exists | bool" - -- name: Ensure Matrix buscarron paths don't exist - ansible.builtin.file: - path: "{{ matrix_bot_buscarron_base_path }}" - state: absent - -- name: Ensure buscarron Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_bot_buscarron_docker_image }}" - state: absent + - name: Ensure Matrix buscarron paths don't exist + ansible.builtin.file: + path: "{{ matrix_bot_buscarron_base_path }}" + state: absent diff --git a/roles/custom/matrix-bot-go-neb/tasks/setup_uninstall.yml b/roles/custom/matrix-bot-go-neb/tasks/setup_uninstall.yml index d5caa86b7..cc5f9fa57 100644 --- a/roles/custom/matrix-bot-go-neb/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bot-go-neb/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-go-neb.service" register: matrix_bot_go_neb_service_stat -- name: Ensure matrix-go-neb is stopped - ansible.builtin.service: - name: matrix-bot-go-neb - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_bot_go_neb_service_stat.stat.exists | bool" +- when: matrix_bot_go_neb_service_stat.stat.exists | bool + block: + - name: Ensure matrix-go-neb is stopped + ansible.builtin.service: + name: matrix-bot-go-neb + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-bot-go-neb.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-go-neb.service" - state: absent - when: "matrix_bot_go_neb_service_stat.stat.exists | bool" + - name: Ensure matrix-bot-go-neb.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-go-neb.service" + state: absent -- name: Ensure systemd reloaded after matrix-bot-go-neb.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_bot_go_neb_service_stat.stat.exists | bool" - -- name: Ensure Matrix go-neb paths don't exist - ansible.builtin.file: - path: "{{ matrix_bot_go_neb_base_path }}" - state: absent - -- name: Ensure go-neb Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_bot_go_neb_docker_image }}" - state: absent + - name: Ensure Matrix go-neb paths don't exist + ansible.builtin.file: + path: "{{ matrix_bot_go_neb_base_path }}" + state: absent diff --git a/roles/custom/matrix-bot-honoroit/tasks/setup_uninstall.yml b/roles/custom/matrix-bot-honoroit/tasks/setup_uninstall.yml index 0fa83a02d..757345861 100644 --- a/roles/custom/matrix-bot-honoroit/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bot-honoroit/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-honoroit.service" register: matrix_bot_honoroit_service_stat -- name: Ensure matrix-honoroit is stopped - ansible.builtin.service: - name: matrix-bot-honoroit - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_bot_honoroit_service_stat.stat.exists | bool" +- when: matrix_bot_honoroit_service_stat.stat.exists | bool + block: + - name: Ensure matrix-honoroit is stopped + ansible.builtin.service: + name: matrix-bot-honoroit + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-bot-honoroit.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-honoroit.service" - state: absent - when: "matrix_bot_honoroit_service_stat.stat.exists | bool" + - name: Ensure matrix-bot-honoroit.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-honoroit.service" + state: absent -- name: Ensure systemd reloaded after matrix-bot-honoroit.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_bot_honoroit_service_stat.stat.exists | bool" - -- name: Ensure Matrix honoroit paths don't exist - ansible.builtin.file: - path: "{{ matrix_bot_honoroit_base_path }}" - state: absent - -- name: Ensure honoroit Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_bot_honoroit_docker_image }}" - state: absent + - name: Ensure Matrix honoroit paths don't exist + ansible.builtin.file: + path: "{{ matrix_bot_honoroit_base_path }}" + state: absent diff --git a/roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_uninstall.yml b/roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_uninstall.yml index c7ee13652..b83ea783b 100644 --- a/roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-matrix-registration-bot.service" register: matrix_bot_matrix_registration_bot_service_stat -- name: Ensure matrix-matrix-registration-bot is stopped - ansible.builtin.service: - name: matrix-bot-matrix-registration-bot - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_bot_matrix_registration_bot_service_stat.stat.exists | bool" +- when: matrix_bot_matrix_registration_bot_service_stat.stat.exists | bool + block: + - name: Ensure matrix-matrix-registration-bot is stopped + ansible.builtin.service: + name: matrix-bot-matrix-registration-bot + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-bot-matrix-registration-bot.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-matrix-registration-bot.service" - state: absent - when: "matrix_bot_matrix_registration_bot_service_stat.stat.exists | bool" + - name: Ensure matrix-bot-matrix-registration-bot.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-matrix-registration-bot.service" + state: absent -- name: Ensure systemd reloaded after matrix-bot-matrix-registration-bot.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_bot_matrix_registration_bot_service_stat.stat.exists | bool" - -- name: Ensure Matrix matrix-registration-bot paths don't exist - ansible.builtin.file: - path: "{{ matrix_bot_matrix_registration_bot_base_path }}" - state: absent - -- name: Ensure matrix-registration-bot Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_bot_matrix_registration_bot_docker_image }}" - state: absent + - name: Ensure Matrix matrix-registration-bot paths don't exist + ansible.builtin.file: + path: "{{ matrix_bot_matrix_registration_bot_base_path }}" + state: absent diff --git a/roles/custom/matrix-bot-matrix-reminder-bot/tasks/setup_uninstall.yml b/roles/custom/matrix-bot-matrix-reminder-bot/tasks/setup_uninstall.yml index 1b940f32e..512c0f2dd 100644 --- a/roles/custom/matrix-bot-matrix-reminder-bot/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bot-matrix-reminder-bot/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-matrix-reminder-bot.service" register: matrix_bot_matrix_reminder_bot_service_stat -- name: Ensure matrix-matrix-reminder-bot is stopped - ansible.builtin.service: - name: matrix-bot-matrix-reminder-bot - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists | bool" +- when: matrix_bot_matrix_reminder_bot_service_stat.stat.exists | bool + block: + - name: Ensure matrix-matrix-reminder-bot is stopped + ansible.builtin.service: + name: matrix-bot-matrix-reminder-bot + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-bot-matrix-reminder-bot.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-matrix-reminder-bot.service" - state: absent - when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists | bool" + - name: Ensure matrix-bot-matrix-reminder-bot.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-matrix-reminder-bot.service" + state: absent -- name: Ensure systemd reloaded after matrix-bot-matrix-reminder-bot.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists | bool" - -- name: Ensure Matrix matrix-reminder-bot paths don't exist - ansible.builtin.file: - path: "{{ matrix_bot_matrix_reminder_bot_base_path }}" - state: absent - -- name: Ensure matrix-reminder-bot Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_bot_matrix_reminder_bot_docker_image }}" - state: absent + - name: Ensure Matrix matrix-reminder-bot paths don't exist + ansible.builtin.file: + path: "{{ matrix_bot_matrix_reminder_bot_base_path }}" + state: absent diff --git a/roles/custom/matrix-bot-maubot/tasks/setup_uninstall.yml b/roles/custom/matrix-bot-maubot/tasks/setup_uninstall.yml index 33b8fc149..9d7695763 100644 --- a/roles/custom/matrix-bot-maubot/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bot-maubot/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-maubot.service" register: matrix_bot_maubot_service_stat -- name: Ensure matrix-bot-maubot is stopped - ansible.builtin.service: - name: matrix-bot-maubot - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_bot_maubot_service_stat.stat.exists | bool" +- when: matrix_bot_maubot_service_stat.stat.exists | bool + block: + - name: Ensure matrix-bot-maubot is stopped + ansible.builtin.service: + name: matrix-bot-maubot + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-bot-maubot.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-maubot.service" - state: absent - when: "matrix_bot_maubot_service_stat.stat.exists | bool" + - name: Ensure matrix-bot-maubot.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-maubot.service" + state: absent -- name: Ensure systemd reloaded after matrix-bot-maubot.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_bot_maubot_service_stat.stat.exists | bool" - -- name: Ensure Matrix maubot paths don't exist - ansible.builtin.file: - path: "{{ matrix_bot_maubot_base_path }}" - state: absent - -- name: Ensure maubot Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_bot_maubot_docker_image }}" - state: absent + - name: Ensure Matrix maubot paths don't exist + ansible.builtin.file: + path: "{{ matrix_bot_maubot_base_path }}" + state: absent diff --git a/roles/custom/matrix-bot-mjolnir/tasks/setup_uninstall.yml b/roles/custom/matrix-bot-mjolnir/tasks/setup_uninstall.yml index 708a7bb01..06be71e15 100644 --- a/roles/custom/matrix-bot-mjolnir/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bot-mjolnir/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-mjolnir.service" register: matrix_bot_mjolnir_service_stat -- name: Ensure matrix-bot-mjolnir is stopped - ansible.builtin.service: - name: matrix-bot-mjolnir - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_bot_mjolnir_service_stat.stat.exists | bool" +- when: matrix_bot_mjolnir_service_stat.stat.exists | bool + block: + - name: Ensure matrix-bot-mjolnir is stopped + ansible.builtin.service: + name: matrix-bot-mjolnir + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-bot-mjolnir.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-mjolnir.service" - state: absent - when: "matrix_bot_mjolnir_service_stat.stat.exists | bool" + - name: Ensure matrix-bot-mjolnir.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-mjolnir.service" + state: absent -- name: Ensure systemd reloaded after matrix-bot-mjolnir.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_bot_mjolnir_service_stat.stat.exists | bool" - -- name: Ensure matrix-bot-mjolnir paths don't exist - ansible.builtin.file: - path: "{{ matrix_bot_mjolnir_base_path }}" - state: absent - -- name: Ensure mjolnir Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_bot_mjolnir_docker_image }}" - state: absent + - name: Ensure matrix-bot-mjolnir paths don't exist + ansible.builtin.file: + path: "{{ matrix_bot_mjolnir_base_path }}" + state: absent diff --git a/roles/custom/matrix-bot-postmoogle/tasks/setup_uninstall.yml b/roles/custom/matrix-bot-postmoogle/tasks/setup_uninstall.yml index 198df7d78..93e00dda2 100644 --- a/roles/custom/matrix-bot-postmoogle/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bot-postmoogle/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-postmoogle.service" register: matrix_bot_postmoogle_service_stat -- name: Ensure matrix-postmoogle is stopped - ansible.builtin.service: - name: matrix-bot-postmoogle - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_bot_postmoogle_service_stat.stat.exists | bool" +- when: matrix_bot_postmoogle_service_stat.stat.exists | bool + block: + - name: Ensure matrix-postmoogle is stopped + ansible.builtin.service: + name: matrix-bot-postmoogle + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-bot-postmoogle.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-postmoogle.service" - state: absent - when: "matrix_bot_postmoogle_service_stat.stat.exists | bool" + - name: Ensure matrix-bot-postmoogle.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-postmoogle.service" + state: absent -- name: Ensure systemd reloaded after matrix-bot-postmoogle.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_bot_postmoogle_service_stat.stat.exists | bool" - -- name: Ensure Matrix postmoogle paths don't exist - ansible.builtin.file: - path: "{{ matrix_bot_postmoogle_base_path }}" - state: absent - -- name: Ensure postmoogle Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_bot_postmoogle_docker_image }}" - state: absent + - name: Ensure Matrix postmoogle paths don't exist + ansible.builtin.file: + path: "{{ matrix_bot_postmoogle_base_path }}" + state: absent diff --git a/roles/custom/matrix-bridge-appservice-discord/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-appservice-discord/tasks/setup_uninstall.yml index 50d108fa5..ca2354c63 100644 --- a/roles/custom/matrix-bridge-appservice-discord/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-appservice-discord/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-discord.service" register: matrix_appservice_discord_service_stat -- name: Ensure matrix-appservice-discord is stopped - ansible.builtin.service: - name: matrix-appservice-discord - state: stopped - enabled: false - daemon_reload: true - when: "matrix_appservice_discord_service_stat.stat.exists" +- when: matrix_appservice_discord_service_stat.stat.exists | bool + block: + - name: Ensure matrix-appservice-discord is stopped + ansible.builtin.service: + name: matrix-appservice-discord + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-appservice-discord.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-discord.service" - state: absent - when: "matrix_appservice_discord_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-appservice-discord.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_appservice_discord_service_stat.stat.exists" + - name: Ensure matrix-appservice-discord.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-discord.service" + state: absent diff --git a/roles/custom/matrix-bridge-appservice-irc/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-appservice-irc/tasks/setup_uninstall.yml index 8921d48e1..f16d3763f 100644 --- a/roles/custom/matrix-bridge-appservice-irc/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-appservice-irc/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-irc.service" register: matrix_appservice_irc_service_stat -- name: Ensure matrix-appservice-irc is stopped - ansible.builtin.service: - name: matrix-appservice-irc - state: stopped - enabled: false - daemon_reload: true - when: "matrix_appservice_irc_service_stat.stat.exists" +- when: matrix_appservice_irc_service_stat.stat.exists | bool + block: + - name: Ensure matrix-appservice-irc is stopped + ansible.builtin.service: + name: matrix-appservice-irc + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-appservice-irc.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-irc.service" - state: absent - when: "matrix_appservice_irc_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-appservice-irc.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_appservice_irc_service_stat.stat.exists" + - name: Ensure matrix-appservice-irc.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-irc.service" + state: absent diff --git a/roles/custom/matrix-bridge-appservice-kakaotalk/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-appservice-kakaotalk/tasks/setup_uninstall.yml index 8e46d80f9..e258b9ab2 100644 --- a/roles/custom/matrix-bridge-appservice-kakaotalk/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-appservice-kakaotalk/tasks/setup_uninstall.yml @@ -11,7 +11,7 @@ state: stopped enabled: false daemon_reload: true - when: "matrix_appservice_kakaotalk_service_stat.stat.exists" + when: matrix_appservice_kakaotalk_service_stat.stat.exists | bool - name: Check existence of matrix-appservice-kakaotalk-node service ansible.builtin.stat: @@ -24,7 +24,7 @@ state: stopped enabled: false daemon_reload: true - when: "matrix_appservice_kakaotalk_node_service_stat.stat.exists" + when: matrix_appservice_kakaotalk_node_service_stat.stat.exists | bool - name: Ensure matrix-appservice-kakaotalk.service files don't exist ansible.builtin.file: @@ -33,9 +33,4 @@ with_items: - "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-kakaotalk-node.service" - "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-kakaotalk.service" - when: "matrix_appservice_kakaotalk_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-appservice-kakaotalk service files removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_appservice_kakaotalk_service_stat.stat.exists or matrix_appservice_kakaotalk_node_service_stat.stat.exists" + when: matrix_appservice_kakaotalk_service_stat.stat.exists | bool or matrix_appservice_kakaotalk_node_service_stat.stat.exists | bool diff --git a/roles/custom/matrix-bridge-appservice-slack/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-appservice-slack/tasks/setup_uninstall.yml index 434f90676..51c77fef0 100644 --- a/roles/custom/matrix-bridge-appservice-slack/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-appservice-slack/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-slack.service" register: matrix_appservice_slack_service_stat -- name: Ensure matrix-appservice-slack is stopped - ansible.builtin.service: - name: matrix-appservice-slack - state: stopped - enabled: false - daemon_reload: true - when: "matrix_appservice_slack_service_stat.stat.exists" +- when: matrix_appservice_slack_service_stat.stat.exists | bool + block: + - name: Ensure matrix-appservice-slack is stopped + ansible.builtin.service: + name: matrix-appservice-slack + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-appservice-slack.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-slack.service" - state: absent - when: "matrix_appservice_slack_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-appservice-slack.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_appservice_slack_service_stat.stat.exists" + - name: Ensure matrix-appservice-slack.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-slack.service" + state: absent diff --git a/roles/custom/matrix-bridge-appservice-webhooks/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-appservice-webhooks/tasks/setup_uninstall.yml index 960fe58b0..c47b724cf 100644 --- a/roles/custom/matrix-bridge-appservice-webhooks/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-appservice-webhooks/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-webhooks.service" register: matrix_appservice_webhooks_service_stat -- name: Ensure matrix-appservice-webhooks is stopped - ansible.builtin.service: - name: matrix-appservice-webhooks - state: stopped - enabled: false - daemon_reload: true - when: "matrix_appservice_webhooks_service_stat.stat.exists" +- when: matrix_appservice_webhooks_service_stat.stat.exists | bool + block: + - name: Ensure matrix-appservice-webhooks is stopped + ansible.builtin.service: + name: matrix-appservice-webhooks + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-appservice-webhooks.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-webhooks.service" - state: absent - when: "matrix_appservice_webhooks_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-appservice-webhooks.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_appservice_webhooks_service_stat.stat.exists" + - name: Ensure matrix-appservice-webhooks.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-webhooks.service" + state: absent diff --git a/roles/custom/matrix-bridge-beeper-linkedin/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-beeper-linkedin/tasks/setup_uninstall.yml index 4a75a4c7a..4d3334692 100644 --- a/roles/custom/matrix-bridge-beeper-linkedin/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-beeper-linkedin/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-beeper-linkedin.service" register: matrix_beeper_linkedin_service_stat -- name: Ensure matrix-beeper-linkedin is stopped - ansible.builtin.service: - name: matrix-beeper-linkedin - state: stopped - enabled: false - daemon_reload: true - when: "matrix_beeper_linkedin_service_stat.stat.exists" +- when: matrix_beeper_linkedin_service_stat.stat.exists | bool + block: + - name: Ensure matrix-beeper-linkedin is stopped + ansible.builtin.service: + name: matrix-beeper-linkedin + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-beeper-linkedin.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-beeper-linkedin.service" - state: absent - when: "matrix_beeper_linkedin_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-beeper-linkedin.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_beeper_linkedin_service_stat.stat.exists" + - name: Ensure matrix-beeper-linkedin.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-beeper-linkedin.service" + state: absent diff --git a/roles/custom/matrix-bridge-go-skype-bridge/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-go-skype-bridge/tasks/setup_uninstall.yml index 975b25ab4..d7b5999a1 100644 --- a/roles/custom/matrix-bridge-go-skype-bridge/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-go-skype-bridge/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "/etc/systemd/system/matrix-go-skype-bridge.service" register: matrix_go_skype_bridge_service_stat -- name: Ensure matrix-go-skype-bridge is stopped - ansible.builtin.service: - name: matrix-go-skype-bridge - state: stopped - enabled: false - daemon_reload: true - when: "matrix_go_skype_bridge_service_stat.stat.exists" +- when: matrix_go_skype_bridge_service_stat.stat.exists | bool + block: + - name: Ensure matrix-go-skype-bridge is stopped + ansible.builtin.service: + name: matrix-go-skype-bridge + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-go-skype-bridge.service doesn't exist - ansible.builtin.file: - path: "/etc/systemd/system/matrix-go-skype-bridge.service" - state: absent - when: "matrix_go_skype_bridge_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-go-skype-bridge.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_go_skype_bridge_service_stat.stat.exists" + - name: Ensure matrix-go-skype-bridge.service doesn't exist + ansible.builtin.file: + path: "/etc/systemd/system/matrix-go-skype-bridge.service" + state: absent diff --git a/roles/custom/matrix-bridge-heisenbridge/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-heisenbridge/tasks/setup_uninstall.yml index 688ff9d47..090427ca3 100644 --- a/roles/custom/matrix-bridge-heisenbridge/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-heisenbridge/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-heisenbridge.service" register: matrix_heisenbridge_service_stat -- name: Ensure matrix-heisenbridge is stopped - ansible.builtin.service: - name: matrix-heisenbridge - state: stopped - enabled: false - daemon_reload: true - when: "matrix_heisenbridge_service_stat.stat.exists" +- when: matrix_heisenbridge_service_stat.stat.exists | bool + block: + - name: Ensure matrix-heisenbridge is stopped + ansible.builtin.service: + name: matrix-heisenbridge + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-heisenbridge.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-heisenbridge.service" - state: absent - when: "matrix_heisenbridge_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-heisenbridge.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_heisenbridge_service_stat.stat.exists" + - name: Ensure matrix-heisenbridge.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-heisenbridge.service" + state: absent diff --git a/roles/custom/matrix-bridge-hookshot/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-hookshot/tasks/setup_uninstall.yml index 2028a34e1..b4c72d38a 100644 --- a/roles/custom/matrix-bridge-hookshot/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-hookshot/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-hookshot.service" register: matrix_hookshot_service_stat -- name: Ensure matrix-hookshot is stopped - ansible.builtin.service: - name: matrix-hookshot - state: stopped - enabled: false - daemon_reload: true - when: "matrix_hookshot_service_stat.stat.exists" +- when: matrix_hookshot_service_stat.stat.exists | bool + block: + - name: Ensure matrix-hookshot is stopped + ansible.builtin.service: + name: matrix-hookshot + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-hookshot.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-hookshot.service" - state: absent - when: "matrix_hookshot_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-hookshot.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_hookshot_service_stat.stat.exists" + - name: Ensure matrix-hookshot.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-hookshot.service" + state: absent diff --git a/roles/custom/matrix-bridge-mautrix-discord/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mautrix-discord/tasks/setup_uninstall.yml index d75f51647..ade37c2f8 100644 --- a/roles/custom/matrix-bridge-mautrix-discord/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-mautrix-discord/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-discord.service" register: matrix_mautrix_discord_service_stat -- name: Ensure matrix-mautrix-discord is stopped - ansible.builtin.service: - name: matrix-mautrix-discord - state: stopped - enabled: false - daemon_reload: true - when: "matrix_mautrix_discord_service_stat.stat.exists" +- when: matrix_mautrix_discord_service_stat.stat.exists | bool + block: + - name: Ensure matrix-mautrix-discord is stopped + ansible.builtin.service: + name: matrix-mautrix-discord + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-mautrix-discord.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-discord.service" - state: absent - when: "matrix_mautrix_discord_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-mautrix-discord.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_mautrix_discord_service_stat.stat.exists" + - name: Ensure matrix-mautrix-discord.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-discord.service" + state: absent diff --git a/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_uninstall.yml index fb235b54a..566da5b71 100644 --- a/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-facebook.service" register: matrix_mautrix_facebook_service_stat -- name: Ensure matrix-mautrix-facebook is stopped - ansible.builtin.service: - name: matrix-mautrix-facebook - state: stopped - enabled: false - daemon_reload: true - when: "matrix_mautrix_facebook_service_stat.stat.exists" +- when: matrix_mautrix_facebook_service_stat.stat.exists | bool + block: + - name: Ensure matrix-mautrix-facebook is stopped + ansible.builtin.service: + name: matrix-mautrix-facebook + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-mautrix-facebook.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-facebook.service" - state: absent - when: "matrix_mautrix_facebook_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-mautrix-facebook.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_mautrix_facebook_service_stat.stat.exists" + - name: Ensure matrix-mautrix-facebook.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-facebook.service" + state: absent diff --git a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_uninstall.yml index 37a4e6751..12b486308 100644 --- a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-googlechat.service" register: matrix_mautrix_googlechat_service_stat -- name: Ensure matrix-mautrix-googlechat is stopped - ansible.builtin.service: - name: matrix-mautrix-googlechat - state: stopped - enabled: false - daemon_reload: true - when: "matrix_mautrix_googlechat_service_stat.stat.exists" +- when: matrix_mautrix_googlechat_service_stat.stat.exists | bool + block: + - name: Ensure matrix-mautrix-googlechat is stopped + ansible.builtin.service: + name: matrix-mautrix-googlechat + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-mautrix-googlechat.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-googlechat.service" - state: absent - when: "matrix_mautrix_googlechat_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-mautrix-googlechat.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_mautrix_googlechat_service_stat.stat.exists" + - name: Ensure matrix-mautrix-googlechat.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-googlechat.service" + state: absent diff --git a/roles/custom/matrix-bridge-mautrix-hangouts/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mautrix-hangouts/tasks/setup_uninstall.yml index b7ff72393..02d7183f6 100644 --- a/roles/custom/matrix-bridge-mautrix-hangouts/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-mautrix-hangouts/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-hangouts.service" register: matrix_mautrix_hangouts_service_stat -- name: Ensure matrix-mautrix-hangouts is stopped - ansible.builtin.service: - name: matrix-mautrix-hangouts - state: stopped - enabled: false - daemon_reload: true - when: "matrix_mautrix_hangouts_service_stat.stat.exists" +- when: matrix_mautrix_hangouts_service_stat.stat.exists | bool + block: + - name: Ensure matrix-mautrix-hangouts is stopped + ansible.builtin.service: + name: matrix-mautrix-hangouts + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-mautrix-hangouts.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-hangouts.service" - state: absent - when: "matrix_mautrix_hangouts_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-mautrix-hangouts.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_mautrix_hangouts_service_stat.stat.exists" + - name: Ensure matrix-mautrix-hangouts.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-hangouts.service" + state: absent diff --git a/roles/custom/matrix-bridge-mautrix-instagram/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mautrix-instagram/tasks/setup_uninstall.yml index a029a90ac..6ac0f6d52 100644 --- a/roles/custom/matrix-bridge-mautrix-instagram/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-mautrix-instagram/tasks/setup_uninstall.yml @@ -4,21 +4,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-instagram.service" register: matrix_mautrix_instagram_service_stat -- name: Ensure matrix-mautrix-instagram is stopped - ansible.builtin.service: - name: matrix-mautrix-instagram - state: stopped - enabled: false - daemon_reload: true - when: "matrix_mautrix_instagram_service_stat.stat.exists" +- when: matrix_mautrix_instagram_service_stat.stat.exists | bool + block: + - name: Ensure matrix-mautrix-instagram is stopped + ansible.builtin.service: + name: matrix-mautrix-instagram + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-mautrix-instagram.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-instagram.service" - state: absent - when: "matrix_mautrix_instagram_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-mautrix-instagram.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_mautrix_instagram_service_stat.stat.exists" + - name: Ensure matrix-mautrix-instagram.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-instagram.service" + state: absent diff --git a/roles/custom/matrix-bridge-mautrix-signal/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mautrix-signal/tasks/setup_uninstall.yml index d98d28ba7..8cc0b419c 100644 --- a/roles/custom/matrix-bridge-mautrix-signal/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-mautrix-signal/tasks/setup_uninstall.yml @@ -6,19 +6,19 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-signal-daemon.service" register: matrix_mautrix_signal_daemon_service_stat -- name: Ensure matrix-mautrix-signal-daemon is stopped - ansible.builtin.service: - name: matrix-mautrix-signal-daemon - state: stopped - enabled: false - daemon_reload: true - when: "matrix_mautrix_signal_daemon_service_stat.stat.exists" +- when: matrix_mautrix_signal_daemon_service_stat.stat.exists | bool + block: + - name: Ensure matrix-mautrix-signal-daemon is stopped + ansible.builtin.service: + name: matrix-mautrix-signal-daemon + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-mautrix-signal-daemon.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-signal-daemon.service" - state: absent - when: "matrix_mautrix_signal_daemon_service_stat.stat.exists" + - name: Ensure matrix-mautrix-signal-daemon.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-signal-daemon.service" + state: absent # Bridge service - name: Check existence of matrix-mautrix-signal service @@ -26,22 +26,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-signal.service" register: matrix_mautrix_signal_service_stat -- name: Ensure matrix-mautrix-signal is stopped - ansible.builtin.service: - name: matrix-mautrix-signal - state: stopped - enabled: false - daemon_reload: true - when: "matrix_mautrix_signal_service_stat.stat.exists" +- when: matrix_mautrix_signal_service_stat.stat.exists | bool + block: + - name: Ensure matrix-mautrix-signal is stopped + ansible.builtin.service: + name: matrix-mautrix-signal + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-mautrix-signal.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-signal.service" - state: absent - when: "matrix_mautrix_signal_service_stat.stat.exists" - -# All services -- name: Ensure systemd reloaded after matrix-mautrix-signal_X.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_mautrix_signal_service_stat.stat.exists or matrix_mautrix_signal_daemon_service_stat.stat.exists" + - name: Ensure matrix-mautrix-signal.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-signal.service" + state: absent diff --git a/roles/custom/matrix-bridge-mautrix-telegram/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mautrix-telegram/tasks/setup_uninstall.yml index 90ca01951..ebb7e5db2 100644 --- a/roles/custom/matrix-bridge-mautrix-telegram/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-mautrix-telegram/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-telegram.service" register: matrix_mautrix_telegram_service_stat -- name: Ensure matrix-mautrix-telegram is stopped - ansible.builtin.service: - name: matrix-mautrix-telegram - state: stopped - enabled: false - daemon_reload: true - when: "matrix_mautrix_telegram_service_stat.stat.exists" +- when: matrix_mautrix_telegram_service_stat.stat.exists | bool + block: + - name: Ensure matrix-mautrix-telegram is stopped + ansible.builtin.service: + name: matrix-mautrix-telegram + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-mautrix-telegram.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-telegram.service" - state: absent - when: "matrix_mautrix_telegram_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-mautrix-telegram.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_mautrix_telegram_service_stat.stat.exists" + - name: Ensure matrix-mautrix-telegram.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-telegram.service" + state: absent diff --git a/roles/custom/matrix-bridge-mautrix-twitter/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mautrix-twitter/tasks/setup_uninstall.yml index 5f6b14916..2a73e4818 100644 --- a/roles/custom/matrix-bridge-mautrix-twitter/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-mautrix-twitter/tasks/setup_uninstall.yml @@ -5,20 +5,15 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-twitter.service" register: matrix_mautrix_twitter_service_stat -- name: Ensure matrix-mautrix-twitter is stopped - ansible.builtin.service: - name: matrix-mautrix-twitter - state: stopped - daemon_reload: true - when: "matrix_mautrix_twitter_service_stat.stat.exists" +- when: matrix_mautrix_twitter_service_stat.stat.exists | bool + block: + - name: Ensure matrix-mautrix-twitter is stopped + ansible.builtin.service: + name: matrix-mautrix-twitter + state: stopped + daemon_reload: true -- name: Ensure matrix-mautrix-twitter.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-twitter.service" - state: absent - when: "matrix_mautrix_twitter_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-mautrix-twitter.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_mautrix_twitter_service_stat.stat.exists" + - name: Ensure matrix-mautrix-twitter.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-twitter.service" + state: absent diff --git a/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/setup_uninstall.yml index ff2150011..98607b945 100644 --- a/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-whatsapp.service" register: matrix_mautrix_whatsapp_service_stat -- name: Ensure matrix-mautrix-whatsapp is stopped - ansible.builtin.service: - name: matrix-mautrix-whatsapp - state: stopped - enabled: false - daemon_reload: true - when: "matrix_mautrix_whatsapp_service_stat.stat.exists" +- when: matrix_mautrix_whatsapp_service_stat.stat.exists | bool + block: + - name: Ensure matrix-mautrix-whatsapp is stopped + ansible.builtin.service: + name: matrix-mautrix-whatsapp + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-mautrix-whatsapp.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-whatsapp.service" - state: absent - when: "matrix_mautrix_whatsapp_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-mautrix-whatsapp.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_mautrix_whatsapp_service_stat.stat.exists" + - name: Ensure matrix-mautrix-whatsapp.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-whatsapp.service" + state: absent diff --git a/roles/custom/matrix-bridge-mx-puppet-discord/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mx-puppet-discord/tasks/setup_uninstall.yml index 585c6c856..c1ed9ec36 100644 --- a/roles/custom/matrix-bridge-mx-puppet-discord/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-mx-puppet-discord/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "/etc/systemd/system/matrix-mx-puppet-discord.service" register: matrix_mx_puppet_discord_service_stat -- name: Ensure matrix-mx-puppet-discord is stopped - ansible.builtin.service: - name: matrix-mx-puppet-discord - state: stopped - enabled: false - daemon_reload: true - when: "matrix_mx_puppet_discord_service_stat.stat.exists" +- when: matrix_mx_puppet_discord_service_stat.stat.exists | bool + block: + - name: Ensure matrix-mx-puppet-discord is stopped + ansible.builtin.service: + name: matrix-mx-puppet-discord + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-mx-puppet-discord.service doesn't exist - ansible.builtin.file: - path: "/etc/systemd/system/matrix-mx-puppet-discord.service" - state: absent - when: "matrix_mx_puppet_discord_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-mx-puppet-discord.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_mx_puppet_discord_service_stat.stat.exists" + - name: Ensure matrix-mx-puppet-discord.service doesn't exist + ansible.builtin.file: + path: "/etc/systemd/system/matrix-mx-puppet-discord.service" + state: absent diff --git a/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/setup_uninstall.yml index 5ded61070..ce0823e6e 100644 --- a/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "/etc/systemd/system/matrix-mx-puppet-groupme.service" register: matrix_mx_puppet_groupme_service_stat -- name: Ensure matrix-mx-puppet-groupme is stopped - ansible.builtin.service: - name: matrix-mx-puppet-groupme - state: stopped - enabled: false - daemon_reload: true - when: "matrix_mx_puppet_groupme_service_stat.stat.exists" +- when: matrix_mx_puppet_groupme_service_stat.stat.exists | bool + block: + - name: Ensure matrix-mx-puppet-groupme is stopped + ansible.builtin.service: + name: matrix-mx-puppet-groupme + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-mx-puppet-groupme.service doesn't exist - ansible.builtin.file: - path: "/etc/systemd/system/matrix-mx-puppet-groupme.service" - state: absent - when: "matrix_mx_puppet_groupme_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-mx-puppet-groupme.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_mx_puppet_groupme_service_stat.stat.exists" + - name: Ensure matrix-mx-puppet-groupme.service doesn't exist + ansible.builtin.file: + path: "/etc/systemd/system/matrix-mx-puppet-groupme.service" + state: absent diff --git a/roles/custom/matrix-bridge-mx-puppet-instagram/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mx-puppet-instagram/tasks/setup_uninstall.yml index 2d5a98aa4..943c0556a 100644 --- a/roles/custom/matrix-bridge-mx-puppet-instagram/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-mx-puppet-instagram/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "/etc/systemd/system/matrix-mx-puppet-instagram.service" register: matrix_mx_puppet_instagram_service_stat -- name: Ensure matrix-mx-puppet-instagram is stopped - ansible.builtin.service: - name: matrix-mx-puppet-instagram - state: stopped - enabled: false - daemon_reload: true - when: "matrix_mx_puppet_instagram_service_stat.stat.exists" +- when: matrix_mx_puppet_instagram_service_stat.stat.exists | bool + block: + - name: Ensure matrix-mx-puppet-instagram is stopped + ansible.builtin.service: + name: matrix-mx-puppet-instagram + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-mx-puppet-instagram.service doesn't exist - ansible.builtin.file: - path: "/etc/systemd/system/matrix-mx-puppet-instagram.service" - state: absent - when: "matrix_mx_puppet_instagram_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-mx-puppet-instagram.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_mx_puppet_instagram_service_stat.stat.exists" + - name: Ensure matrix-mx-puppet-instagram.service doesn't exist + ansible.builtin.file: + path: "/etc/systemd/system/matrix-mx-puppet-instagram.service" + state: absent diff --git a/roles/custom/matrix-bridge-mx-puppet-slack/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mx-puppet-slack/tasks/setup_uninstall.yml index 3f91b467b..444939198 100644 --- a/roles/custom/matrix-bridge-mx-puppet-slack/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-mx-puppet-slack/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "/etc/systemd/system/matrix-mx-puppet-slack.service" register: matrix_mx_puppet_slack_service_stat -- name: Ensure matrix-mx-puppet-slack is stopped - ansible.builtin.service: - name: matrix-mx-puppet-slack - state: stopped - enabled: false - daemon_reload: true - when: "matrix_mx_puppet_slack_service_stat.stat.exists" +- when: matrix_mx_puppet_slack_service_stat.stat.exists | bool + block: + - name: Ensure matrix-mx-puppet-slack is stopped + ansible.builtin.service: + name: matrix-mx-puppet-slack + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-mx-puppet-slack.service doesn't exist - ansible.builtin.file: - path: "/etc/systemd/system/matrix-mx-puppet-slack.service" - state: absent - when: "matrix_mx_puppet_slack_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-mx-puppet-slack.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_mx_puppet_slack_service_stat.stat.exists" + - name: Ensure matrix-mx-puppet-slack.service doesn't exist + ansible.builtin.file: + path: "/etc/systemd/system/matrix-mx-puppet-slack.service" + state: absent diff --git a/roles/custom/matrix-bridge-mx-puppet-steam/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mx-puppet-steam/tasks/setup_uninstall.yml index d88e54722..75d0ebc0f 100644 --- a/roles/custom/matrix-bridge-mx-puppet-steam/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-mx-puppet-steam/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "/etc/systemd/system/matrix-mx-puppet-steam.service" register: matrix_mx_puppet_steam_service_stat -- name: Ensure matrix-mx-puppet-steam is stopped - ansible.builtin.service: - name: matrix-mx-puppet-steam - state: stopped - enabled: false - daemon_reload: true - when: "matrix_mx_puppet_steam_service_stat.stat.exists" +- when: matrix_mx_puppet_steam_service_stat.stat.exists | bool + block: + - name: Ensure matrix-mx-puppet-steam is stopped + ansible.builtin.service: + name: matrix-mx-puppet-steam + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-mx-puppet-steam.service doesn't exist - ansible.builtin.file: - path: "/etc/systemd/system/matrix-mx-puppet-steam.service" - state: absent - when: "matrix_mx_puppet_steam_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-mx-puppet-steam.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_mx_puppet_steam_service_stat.stat.exists" + - name: Ensure matrix-mx-puppet-steam.service doesn't exist + ansible.builtin.file: + path: "/etc/systemd/system/matrix-mx-puppet-steam.service" + state: absent diff --git a/roles/custom/matrix-bridge-mx-puppet-twitter/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mx-puppet-twitter/tasks/setup_uninstall.yml index 6db13de08..c529f0b34 100644 --- a/roles/custom/matrix-bridge-mx-puppet-twitter/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-mx-puppet-twitter/tasks/setup_uninstall.yml @@ -5,21 +5,16 @@ path: "/etc/systemd/system/matrix-mx-puppet-twitter.service" register: matrix_mx_puppet_twitter_service_stat -- name: Ensure matrix-mx-puppet-twitter is stopped - ansible.builtin.service: - name: matrix-mx-puppet-twitter - state: stopped - enabled: false - daemon_reload: true - when: "matrix_mx_puppet_twitter_service_stat.stat.exists" +- when: matrix_mx_puppet_twitter_service_stat.stat.exists | bool + block: + - name: Ensure matrix-mx-puppet-twitter is stopped + ansible.builtin.service: + name: matrix-mx-puppet-twitter + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-mx-puppet-twitter.service doesn't exist - ansible.builtin.file: - path: "/etc/systemd/system/matrix-mx-puppet-twitter.service" - state: absent - when: "matrix_mx_puppet_twitter_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-mx-puppet-twitter.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_mx_puppet_twitter_service_stat.stat.exists" + - name: Ensure matrix-mx-puppet-twitter.service doesn't exist + ansible.builtin.file: + path: "/etc/systemd/system/matrix-mx-puppet-twitter.service" + state: absent diff --git a/roles/custom/matrix-cactus-comments/tasks/setup_uninstall.yml b/roles/custom/matrix-cactus-comments/tasks/setup_uninstall.yml index bd46f252b..e3a5f3909 100644 --- a/roles/custom/matrix-cactus-comments/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-cactus-comments/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-cactus-comments.service" register: matrix_cactus_comments_service_stat -- name: Ensure cactus comments is stopped - ansible.builtin.service: - name: matrix-cactus-comments - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_cactus_comments_service_stat.stat.exists | bool" +- when: matrix_cactus_comments_service_stat.stat.exists | bool + block: + - name: Ensure cactus comments is stopped + ansible.builtin.service: + name: matrix-cactus-comments + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-cactus-comments.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-cactus-comments.service" - state: absent - when: "matrix_cactus_comments_service_stat.stat.exists | bool" + - name: Ensure matrix-cactus-comments.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-cactus-comments.service" + state: absent -- name: Ensure systemd reloaded after matrix-cactus-comments.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_cactus_comments_service_stat.stat.exists | bool" - -- name: Ensure Matrix cactus comments paths don't exist - ansible.builtin.file: - path: "{{ matrix_cactus_comments_base_path }}" - state: absent - -- name: Ensure cactus comments Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_cactus_comments_docker_image }}" - state: absent + - name: Ensure Matrix cactus comments paths don't exist + ansible.builtin.file: + path: "{{ matrix_cactus_comments_base_path }}" + state: absent diff --git a/roles/custom/matrix-client-cinny/tasks/setup_uninstall.yml b/roles/custom/matrix-client-cinny/tasks/setup_uninstall.yml index 5b67e819e..a73825623 100644 --- a/roles/custom/matrix-client-cinny/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-client-cinny/tasks/setup_uninstall.yml @@ -4,32 +4,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-client-cinny.service" register: matrix_client_cinny_service_stat -- name: Ensure matrix-client-cinny is stopped - ansible.builtin.service: - name: matrix-client-cinny - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_client_cinny_service_stat.stat.exists | bool" +- when: matrix_client_cinny_service_stat.stat.exists | bool + block: + - name: Ensure matrix-client-cinny is stopped + ansible.builtin.service: + name: matrix-client-cinny + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-client-cinny.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-client-cinny.service" - state: absent - when: "matrix_client_cinny_service_stat.stat.exists | bool" + - name: Ensure matrix-client-cinny.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-client-cinny.service" + state: absent -- name: Ensure systemd reloaded after matrix-client-cinny.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_client_cinny_service_stat.stat.exists | bool" - -- name: Ensure Cinny paths doesn't exist - ansible.builtin.file: - path: "{{ matrix_client_cinny_data_path }}" - state: absent - -- name: Ensure Cinny Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_client_cinny_docker_image }}" - state: absent + - name: Ensure Cinny paths doesn't exist + ansible.builtin.file: + path: "{{ matrix_client_cinny_data_path }}" + state: absent diff --git a/roles/custom/matrix-client-element/tasks/setup_uninstall.yml b/roles/custom/matrix-client-element/tasks/setup_uninstall.yml index 3a1de4094..e1b25caa6 100644 --- a/roles/custom/matrix-client-element/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-client-element/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-client-element.service" register: matrix_client_element_service_stat -- name: Ensure matrix-client-element is stopped - ansible.builtin.service: - name: matrix-client-element - state: stopped - 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 + block: + - name: Ensure matrix-client-element is stopped + ansible.builtin.service: + name: matrix-client-element + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-client-element.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-client-element.service" - state: absent - when: "matrix_client_element_service_stat.stat.exists | bool" + - name: Ensure matrix-client-element.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-client-element.service" + state: absent -- 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" - -- name: Ensure Element paths doesn't exist - ansible.builtin.file: - path: "{{ matrix_client_element_data_path }}" - state: absent - -- name: Ensure Element Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_client_element_docker_image }}" - state: absent + - name: Ensure Element paths doesn't exist + ansible.builtin.file: + path: "{{ matrix_client_element_data_path }}" + state: absent diff --git a/roles/custom/matrix-client-hydrogen/tasks/setup_uninstall.yml b/roles/custom/matrix-client-hydrogen/tasks/setup_uninstall.yml index 090ce5673..d6caa5b97 100644 --- a/roles/custom/matrix-client-hydrogen/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-client-hydrogen/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-client-hydrogen.service" register: matrix_client_hydrogen_service_stat -- name: Ensure matrix-client-hydrogen is stopped - ansible.builtin.service: - name: matrix-client-hydrogen - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_client_hydrogen_service_stat.stat.exists | bool" +- when: matrix_client_hydrogen_service_stat.stat.exists | bool + block: + - name: Ensure matrix-client-hydrogen is stopped + ansible.builtin.service: + name: matrix-client-hydrogen + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-client-hydrogen.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-client-hydrogen.service" - state: absent - when: "matrix_client_hydrogen_service_stat.stat.exists | bool" + - name: Ensure matrix-client-hydrogen.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-client-hydrogen.service" + state: absent -- name: Ensure systemd reloaded after matrix-client-hydrogen.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_client_hydrogen_service_stat.stat.exists | bool" - -- name: Ensure Hydrogen paths doesn't exist - ansible.builtin.file: - path: "{{ matrix_client_hydrogen_data_path }}" - state: absent - -- name: Ensure Hydrogen Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_client_hydrogen_docker_image }}" - state: absent + - name: Ensure Hydrogen paths doesn't exist + ansible.builtin.file: + path: "{{ matrix_client_hydrogen_data_path }}" + state: absent diff --git a/roles/custom/matrix-conduit/tasks/setup_uninstall.yml b/roles/custom/matrix-conduit/tasks/setup_uninstall.yml index efe7d40a0..1745ff973 100644 --- a/roles/custom/matrix-conduit/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-conduit/tasks/setup_uninstall.yml @@ -5,26 +5,15 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-conduit.service" register: matrix_conduit_service_stat -- name: Ensure matrix-conduit is stopped - ansible.builtin.systemd: - name: matrix-conduit - state: stopped - daemon_reload: true - register: stopping_result - when: "matrix_conduit_service_stat.stat.exists" +- when: matrix_conduit_service_stat.stat.exists | bool + block: + - name: Ensure matrix-conduit is stopped + ansible.builtin.systemd: + name: matrix-conduit + state: stopped + daemon_reload: true -- name: Ensure matrix-conduit.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-conduit.service" - state: absent - when: "matrix_conduit_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-conduit.service removal - ansible.builtin.systemd: - daemon_reload: true - when: "matrix_conduit_service_stat.stat.exists" - -- name: Ensure Conduit Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_conduit_docker_image }}" - state: absent + - name: Ensure matrix-conduit.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-conduit.service" + state: absent diff --git a/roles/custom/matrix-corporal/tasks/setup_uninstall.yml b/roles/custom/matrix-corporal/tasks/setup_uninstall.yml index 81e1b751d..6c6e8063a 100644 --- a/roles/custom/matrix-corporal/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-corporal/tasks/setup_uninstall.yml @@ -13,26 +13,16 @@ state: stopped enabled: false daemon_reload: true - register: stopping_result - name: Ensure matrix-corporal.service doesn't exist ansible.builtin.file: path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-corporal.service" state: absent - - name: Ensure systemd reloaded after matrix-corporal.service removal - ansible.builtin.service: - daemon_reload: true - -- name: Ensure matrix-corporal files don't exist - ansible.builtin.file: - path: "{{ item }}" - state: absent - with_items: - - "{{ devture_systemd_docker_base_systemd_path }}/matrix-corporal.service" - - "{{ matrix_corporal_config_dir_path }}/config.json" - -- name: Ensure Matrix Corporal Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_corporal_docker_image }}" - state: absent + - name: Ensure matrix-corporal files don't exist + ansible.builtin.file: + path: "{{ item }}" + state: absent + with_items: + - "{{ devture_systemd_docker_base_systemd_path }}/matrix-corporal.service" + - "{{ matrix_corporal_config_dir_path }}/config.json" diff --git a/roles/custom/matrix-coturn/tasks/setup_uninstall.yml b/roles/custom/matrix-coturn/tasks/setup_uninstall.yml index bf71b90ae..e747ff094 100644 --- a/roles/custom/matrix-coturn/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-coturn/tasks/setup_uninstall.yml @@ -6,42 +6,33 @@ register: matrix_coturn_service_stat when: "not matrix_coturn_enabled | bool" -- name: Ensure matrix-coturn is stopped - ansible.builtin.service: - name: matrix-coturn - state: stopped - enabled: false - daemon_reload: true - when: "matrix_coturn_service_stat.stat.exists | 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 - when: "matrix_coturn_service_stat.stat.exists | bool" + - 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 - register: matrix_coturn_systemd_unit_uninstallation_result - with_items: - - matrix-coturn.service - - matrix-coturn-reload.service - - matrix-coturn-reload.timer + - 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 systemd reloaded after unit removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_coturn_systemd_unit_uninstallation_result.changed | bool" - -- name: Ensure Matrix coturn paths don't exist - ansible.builtin.file: - path: "{{ matrix_coturn_base_path }}" - state: absent - -# Intentionally not removing the Docker image when uninstalling. -# We can't be sure it had been pulled by us in the first place. + - name: Ensure Matrix coturn paths don't exist + ansible.builtin.file: + path: "{{ matrix_coturn_base_path }}" + state: absent diff --git a/roles/custom/matrix-dendrite/tasks/setup_uninstall.yml b/roles/custom/matrix-dendrite/tasks/setup_uninstall.yml index e37b219c3..e5479684c 100644 --- a/roles/custom/matrix-dendrite/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-dendrite/tasks/setup_uninstall.yml @@ -12,14 +12,8 @@ name: matrix-dendrite state: stopped daemon_reload: true - register: stopping_result - name: Ensure matrix-dendrite.service doesn't exist ansible.builtin.file: path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-dendrite.service" state: absent - - - name: Ensure Dendrite Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_dendrite_docker_image }}" - state: absent diff --git a/roles/custom/matrix-dimension/tasks/setup_uninstall.yml b/roles/custom/matrix-dimension/tasks/setup_uninstall.yml index 8a5f5c755..239e4d892 100644 --- a/roles/custom/matrix-dimension/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-dimension/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-dimension.service" register: matrix_dimension_service_stat -- name: Ensure matrix-dimension is stopped - ansible.builtin.service: - name: matrix-dimension - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_dimension_service_stat.stat.exists | bool" +- when: matrix_dimension_service_stat.stat.exists | bool + block: + - name: Ensure matrix-dimension is stopped + ansible.builtin.service: + name: matrix-dimension + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-dimension.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-dimension.service" - state: absent - when: "matrix_dimension_service_stat.stat.exists | bool" + - name: Ensure matrix-dimension.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-dimension.service" + state: absent -- name: Ensure systemd reloaded after matrix-dimension.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_dimension_service_stat.stat.exists | bool" - -- name: Ensure Dimension base directory doesn't exist - ansible.builtin.file: - path: "{{ matrix_dimension_base_path }}" - state: absent - -- name: Ensure Dimension Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_dimension_docker_image }}" - state: absent + - name: Ensure Dimension base directory doesn't exist + ansible.builtin.file: + path: "{{ matrix_dimension_base_path }}" + state: absent diff --git a/roles/custom/matrix-dynamic-dns/tasks/setup_uninstall.yml b/roles/custom/matrix-dynamic-dns/tasks/setup_uninstall.yml index 7b4e76671..8f9f1b040 100644 --- a/roles/custom/matrix-dynamic-dns/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-dynamic-dns/tasks/setup_uninstall.yml @@ -5,24 +5,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-dynamic-dns.service" register: matrix_dynamic_dns_service_stat -- name: Ensure matrix-dynamic-dns is stopped - ansible.builtin.service: - name: matrix-dynamic-dns - state: stopped - enabled: false - daemon_reload: true - when: "matrix_dynamic_dns_service_stat.stat.exists" +- when: matrix_dynamic_dns_service_stat.stat.exists | bool + block: + - name: Ensure matrix-dynamic-dns is stopped + ansible.builtin.service: + name: matrix-dynamic-dns + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-dynamic-dns.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-dynamic-dns.service" - state: absent - when: "matrix_dynamic_dns_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-dynamic-dns.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_dynamic_dns_service_stat.stat.exists" - -# Intentionally not removing the Docker image when uninstalling. -# We can't be sure it had been pulled by us in the first place. + - name: Ensure matrix-dynamic-dns.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-dynamic-dns.service" + state: absent diff --git a/roles/custom/matrix-email2matrix/tasks/setup_uninstall.yml b/roles/custom/matrix-email2matrix/tasks/setup_uninstall.yml index c9600d0c9..e95ce6617 100644 --- a/roles/custom/matrix-email2matrix/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-email2matrix/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-email2matrix.service" register: matrix_email2matrix_service_stat -- name: Ensure matrix-email2matrix is stopped - ansible.builtin.service: - name: matrix-email2matrix - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_email2matrix_service_stat.stat.exists | bool" +- when: matrix_email2matrix_service_stat.stat.exists | bool + block: + - name: Ensure matrix-email2matrix is stopped + ansible.builtin.service: + name: matrix-email2matrix + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-email2matrix.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-email2matrix.service" - state: absent - when: "matrix_email2matrix_service_stat.stat.exists | bool" + - name: Ensure matrix-email2matrix.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-email2matrix.service" + state: absent -- name: Ensure systemd reloaded after matrix-email2matrix.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_email2matrix_service_stat.stat.exists | bool" - -- name: Ensure Email2Matrix data path doesn't exist - ansible.builtin.file: - path: "{{ matrix_email2matrix_base_path }}" - state: absent - -- name: Ensure Email2Matrix Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_email2matrix_docker_image }}" - state: absent + - name: Ensure Email2Matrix data path doesn't exist + ansible.builtin.file: + path: "{{ matrix_email2matrix_base_path }}" + state: absent diff --git a/roles/custom/matrix-etherpad/tasks/setup_uninstall.yml b/roles/custom/matrix-etherpad/tasks/setup_uninstall.yml index 7d93b9ab2..e03829845 100644 --- a/roles/custom/matrix-etherpad/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-etherpad/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-etherpad.service" register: matrix_etherpad_service_stat -- name: Ensure matrix-etherpad is stopped - ansible.builtin.service: - name: matrix-etherpad - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_etherpad_service_stat.stat.exists | bool" +- when: matrix_etherpad_service_stat.stat.exists | bool + block: + - name: Ensure matrix-etherpad is stopped + ansible.builtin.service: + name: matrix-etherpad + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-etherpad.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-etherpad.service" - state: absent - when: "matrix_etherpad_service_stat.stat.exists | bool" + - name: Ensure matrix-etherpad.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-etherpad.service" + state: absent -- name: Ensure systemd reloaded after matrix-etherpad.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_etherpad_service_stat.stat.exists | bool" - -- name: Ensure Etherpad base directory doesn't exist - ansible.builtin.file: - path: "{{ matrix_etherpad_base_path }}" - state: absent - -- name: Ensure Etherpad Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_etherpad_docker_image }}" - state: absent + - name: Ensure Etherpad base directory doesn't exist + ansible.builtin.file: + path: "{{ matrix_etherpad_base_path }}" + state: absent diff --git a/roles/custom/matrix-grafana/tasks/setup_uninstall.yml b/roles/custom/matrix-grafana/tasks/setup_uninstall.yml index 6c054ff09..12c3cde93 100644 --- a/roles/custom/matrix-grafana/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-grafana/tasks/setup_uninstall.yml @@ -13,7 +13,6 @@ state: stopped enabled: false daemon_reload: true - register: stopping_result - name: Ensure matrix-grafana.service doesn't exist ansible.builtin.file: diff --git a/roles/custom/matrix-jitsi/tasks/setup_jitsi_jicofo_uninstall.yml b/roles/custom/matrix-jitsi/tasks/setup_jitsi_jicofo_uninstall.yml index 8e76ddea3..6ddd89375 100644 --- a/roles/custom/matrix-jitsi/tasks/setup_jitsi_jicofo_uninstall.yml +++ b/roles/custom/matrix-jitsi/tasks/setup_jitsi_jicofo_uninstall.yml @@ -13,7 +13,6 @@ state: stopped enabled: false daemon_reload: true - register: stopping_result - name: Ensure matrix-jitsi-jicofo.service doesn't exist ansible.builtin.file: diff --git a/roles/custom/matrix-jitsi/tasks/setup_jitsi_jvb_uninstall.yml b/roles/custom/matrix-jitsi/tasks/setup_jitsi_jvb_uninstall.yml index f883a3a2f..e3d7094f0 100644 --- a/roles/custom/matrix-jitsi/tasks/setup_jitsi_jvb_uninstall.yml +++ b/roles/custom/matrix-jitsi/tasks/setup_jitsi_jvb_uninstall.yml @@ -13,7 +13,6 @@ state: stopped enabled: false daemon_reload: true - register: stopping_result - name: Ensure matrix-jitsi-jvb.service doesn't exist ansible.builtin.file: diff --git a/roles/custom/matrix-jitsi/tasks/setup_jitsi_prosody_uninstall.yml b/roles/custom/matrix-jitsi/tasks/setup_jitsi_prosody_uninstall.yml index 3fd44f72d..4907b2a1d 100644 --- a/roles/custom/matrix-jitsi/tasks/setup_jitsi_prosody_uninstall.yml +++ b/roles/custom/matrix-jitsi/tasks/setup_jitsi_prosody_uninstall.yml @@ -13,7 +13,6 @@ state: stopped enabled: false daemon_reload: true - register: stopping_result - name: Ensure matrix-jitsi-prosody.service file doesn't exist ansible.builtin.file: diff --git a/roles/custom/matrix-jitsi/tasks/setup_jitsi_web_uninstall.yml b/roles/custom/matrix-jitsi/tasks/setup_jitsi_web_uninstall.yml index 7c99c2802..1707d7e9b 100644 --- a/roles/custom/matrix-jitsi/tasks/setup_jitsi_web_uninstall.yml +++ b/roles/custom/matrix-jitsi/tasks/setup_jitsi_web_uninstall.yml @@ -13,7 +13,6 @@ state: stopped enabled: false daemon_reload: true - register: stopping_result - name: Ensure matrix-jitsi-web.service doesn't exist ansible.builtin.file: diff --git a/roles/custom/matrix-ldap-registration-proxy/tasks/setup_uninstall.yml b/roles/custom/matrix-ldap-registration-proxy/tasks/setup_uninstall.yml index ed19ad9c1..1d99b4062 100644 --- a/roles/custom/matrix-ldap-registration-proxy/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-ldap-registration-proxy/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-ldap-registration-proxy.service" register: matrix_ldap_registration_proxy_service_stat -- name: Ensure matrix-matrix_ldap_registration_proxy is stopped - ansible.builtin.service: - name: matrix-matrix_ldap_registration_proxy - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_ldap_registration_proxy_service_stat.stat.exists | bool" +- when: matrix_ldap_registration_proxy_service_stat.stat.exists | bool + block: + - name: Ensure matrix-matrix_ldap_registration_proxy is stopped + ansible.builtin.service: + name: matrix-matrix_ldap_registration_proxy + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-ldap-registration-proxy.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-ldap-registration-proxy.service" - state: absent - when: "matrix_ldap_registration_proxy_service_stat.stat.exists | bool" + - name: Ensure matrix-ldap-registration-proxy.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-ldap-registration-proxy.service" + state: absent -- name: Ensure systemd reloaded after matrix-ldap-registration-proxy.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_ldap_registration_proxy_service_stat.stat.exists | bool" - -- name: Ensure Matrix matrix_ldap_registration_proxy paths don't exist - ansible.builtin.file: - path: "{{ matrix_ldap_registration_proxy_base_path }}" - state: absent - -- name: Ensure matrix_ldap_registration_proxy Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_ldap_registration_proxy_docker_image }}" - state: absent + - name: Ensure Matrix matrix_ldap_registration_proxy paths don't exist + ansible.builtin.file: + path: "{{ matrix_ldap_registration_proxy_base_path }}" + state: absent diff --git a/roles/custom/matrix-ma1sd/tasks/setup_uninstall.yml b/roles/custom/matrix-ma1sd/tasks/setup_uninstall.yml index c7e8bf633..b27df269e 100644 --- a/roles/custom/matrix-ma1sd/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-ma1sd/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-ma1sd.service" register: matrix_ma1sd_service_stat -- name: Ensure matrix-ma1sd is stopped - ansible.builtin.service: - name: matrix-ma1sd - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_ma1sd_service_stat.stat.exists | bool" +- when: matrix_ma1sd_service_stat.stat.exists | bool + block: + - name: Ensure matrix-ma1sd is stopped + ansible.builtin.service: + name: matrix-ma1sd + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-ma1sd.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-ma1sd.service" - state: absent - when: "matrix_ma1sd_service_stat.stat.exists | bool" + - name: Ensure matrix-ma1sd.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-ma1sd.service" + state: absent -- name: Ensure systemd reloaded after matrix-ma1sd.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_ma1sd_service_stat.stat.exists | bool" - -- name: Ensure Matrix ma1sd paths don't exist - ansible.builtin.file: - path: "{{ matrix_ma1sd_base_path }}" - state: absent - -- name: Ensure ma1sd Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_ma1sd_docker_image }}" - state: absent + - name: Ensure Matrix ma1sd paths don't exist + ansible.builtin.file: + path: "{{ matrix_ma1sd_base_path }}" + state: absent diff --git a/roles/custom/matrix-mailer/tasks/setup_uninstall.yml b/roles/custom/matrix-mailer/tasks/setup_uninstall.yml index d8fb65c30..fce8a4362 100644 --- a/roles/custom/matrix-mailer/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-mailer/tasks/setup_uninstall.yml @@ -13,23 +13,13 @@ state: stopped enabled: false daemon_reload: true - register: stopping_result - name: Ensure matrix-mailer.service doesn't exist ansible.builtin.file: path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mailer.service" state: absent - - name: Ensure systemd reloaded after matrix-mailer.service removal - ansible.builtin.service: - daemon_reload: true - -- name: Ensure Matrix mailer path doesn't exist - ansible.builtin.file: - path: "{{ matrix_mailer_base_path }}" - state: absent - -- name: Ensure mailer Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_mailer_docker_image }}" - state: absent + - name: Ensure Matrix mailer path doesn't exist + ansible.builtin.file: + path: "{{ matrix_mailer_base_path }}" + state: absent diff --git a/roles/custom/matrix-nginx-proxy/tasks/setup_nginx_proxy.yml b/roles/custom/matrix-nginx-proxy/tasks/setup_nginx_proxy.yml index 50e8ab9b9..af086298e 100644 --- a/roles/custom/matrix-nginx-proxy/tasks/setup_nginx_proxy.yml +++ b/roles/custom/matrix-nginx-proxy/tasks/setup_nginx_proxy.yml @@ -239,7 +239,6 @@ state: stopped enabled: false daemon_reload: true - register: stopping_result when: "not matrix_nginx_proxy_enabled | bool and matrix_nginx_proxy_service_stat.stat.exists" - name: Ensure matrix-nginx-proxy.service doesn't exist diff --git a/roles/custom/matrix-ntfy/tasks/setup_uninstall.yml b/roles/custom/matrix-ntfy/tasks/setup_uninstall.yml index e0eedfd83..afd826f8d 100644 --- a/roles/custom/matrix-ntfy/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-ntfy/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-ntfy.service" register: matrix_ntfy_service_stat -- name: Ensure matrix-ntfy is stopped - ansible.builtin.service: - name: matrix-ntfy - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_ntfy_service_stat.stat.exists" +- when: matrix_ntfy_service_stat.stat.exists | bool + block: + - name: Ensure matrix-ntfy is stopped + ansible.builtin.service: + name: matrix-ntfy + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-ntfy.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-ntfy.service" - state: absent - when: "matrix_ntfy_service_stat.stat.exists" + - name: Ensure matrix-ntfy.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-ntfy.service" + state: absent -- name: Ensure systemd reloaded after matrix-ntfy.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_ntfy_service_stat.stat.exists" - -- name: Ensure matrix-ntfy path doesn't exist - ansible.builtin.file: - path: "{{ matrix_ntfy_base_path }}" - state: absent - -- name: Ensure ntfy Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_ntfy_docker_image }}" - state: absent + - name: Ensure matrix-ntfy path doesn't exist + ansible.builtin.file: + path: "{{ matrix_ntfy_base_path }}" + state: absent diff --git a/roles/custom/matrix-postgres-backup/tasks/setup_uninstall.yml b/roles/custom/matrix-postgres-backup/tasks/setup_uninstall.yml index 0b3709ebe..61b6840c8 100644 --- a/roles/custom/matrix-postgres-backup/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-postgres-backup/tasks/setup_uninstall.yml @@ -20,10 +20,6 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-postgres-backup.service" state: absent - - name: Ensure systemd reloaded after matrix-postgres-backup.service removal - ansible.builtin.service: - daemon_reload: true - - name: Check existence of matrix-postgres-backup backup path ansible.builtin.stat: path: "{{ matrix_postgres_backup_path }}" diff --git a/roles/custom/matrix-prometheus-node-exporter/tasks/setup_uninstall.yml b/roles/custom/matrix-prometheus-node-exporter/tasks/setup_uninstall.yml index 7239c0ac1..b5ef4f0f7 100644 --- a/roles/custom/matrix-prometheus-node-exporter/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-prometheus-node-exporter/tasks/setup_uninstall.yml @@ -13,13 +13,8 @@ state: stopped enabled: false daemon_reload: true - register: stopping_result - name: Ensure matrix-prometheus-node-exporter.service doesn't exist ansible.builtin.file: path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-prometheus-node-exporter.service" state: absent - - - name: Ensure systemd reloaded after matrix-prometheus-node-exporter.service removal - ansible.builtin.service: - daemon_reload: true diff --git a/roles/custom/matrix-prometheus-postgres-exporter/tasks/setup_uninstall.yml b/roles/custom/matrix-prometheus-postgres-exporter/tasks/setup_uninstall.yml index b3fdfd591..bdf720428 100644 --- a/roles/custom/matrix-prometheus-postgres-exporter/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-prometheus-postgres-exporter/tasks/setup_uninstall.yml @@ -13,7 +13,6 @@ state: stopped enabled: false daemon_reload: true - register: stopping_result - name: Ensure matrix-prometheus-postgres-exporter.service doesn't exist ansible.builtin.file: diff --git a/roles/custom/matrix-prometheus/tasks/setup_uninstall.yml b/roles/custom/matrix-prometheus/tasks/setup_uninstall.yml index 5fe145fc3..9d13d2160 100644 --- a/roles/custom/matrix-prometheus/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-prometheus/tasks/setup_uninstall.yml @@ -5,22 +5,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-prometheus.service" register: matrix_prometheus_service_stat -- name: Ensure matrix-prometheus is stopped - ansible.builtin.service: - name: matrix-prometheus - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_prometheus_service_stat.stat.exists | bool" +- when: matrix_prometheus_service_stat.stat.exists | bool + block: + - name: Ensure matrix-prometheus is stopped + ansible.builtin.service: + name: matrix-prometheus + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-prometheus.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-prometheus.service" - state: absent - when: "matrix_prometheus_service_stat.stat.exists | bool" - -- name: Ensure systemd reloaded after matrix-prometheus.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_prometheus_service_stat.stat.exists | bool" + - name: Ensure matrix-prometheus.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-prometheus.service" + state: absent diff --git a/roles/custom/matrix-registration/tasks/setup_uninstall.yml b/roles/custom/matrix-registration/tasks/setup_uninstall.yml index 623db421e..97c144358 100644 --- a/roles/custom/matrix-registration/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-registration/tasks/setup_uninstall.yml @@ -5,27 +5,16 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-registration.service" register: matrix_registration_service_stat -- name: Ensure matrix-registration is stopped - ansible.builtin.service: - name: matrix-registration - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_registration_service_stat.stat.exists | bool" +- when: matrix_registration_service_stat.stat.exists | bool + block: + - name: Ensure matrix-registration is stopped + ansible.builtin.service: + name: matrix-registration + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-registration.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-registration.service" - state: absent - when: "matrix_registration_service_stat.stat.exists | bool" - -- name: Ensure systemd reloaded after matrix-registration.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_registration_service_stat.stat.exists | bool" - -- name: Ensure matrix-registration Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_registration_docker_image }}" - state: absent + - name: Ensure matrix-registration.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-registration.service" + state: absent diff --git a/roles/custom/matrix-sygnal/tasks/setup_uninstall.yml b/roles/custom/matrix-sygnal/tasks/setup_uninstall.yml index e398f7a99..5f01daf1f 100644 --- a/roles/custom/matrix-sygnal/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-sygnal/tasks/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-sygnal.service" register: matrix_sygnal_service_stat -- name: Ensure matrix-sygnal is stopped - ansible.builtin.service: - name: matrix-sygnal - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_sygnal_service_stat.stat.exists | bool" +- when: matrix_sygnal_service_stat.stat.exists | bool + block: + - name: Ensure matrix-sygnal is stopped + ansible.builtin.service: + name: matrix-sygnal + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-sygnal.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-sygnal.service" - state: absent - when: "matrix_sygnal_service_stat.stat.exists | bool" + - name: Ensure matrix-sygnal.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-sygnal.service" + state: absent -- name: Ensure systemd reloaded after matrix-sygnal.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_sygnal_service_stat.stat.exists | bool" - -- name: Ensure Sygnal base directory doesn't exist - ansible.builtin.file: - path: "{{ matrix_sygnal_base_path }}" - state: absent - -- name: Ensure Sygnal Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_sygnal_docker_image }}" - state: absent + - name: Ensure Sygnal base directory doesn't exist + ansible.builtin.file: + path: "{{ matrix_sygnal_base_path }}" + state: absent diff --git a/roles/custom/matrix-synapse-admin/tasks/setup_uninstall.yml b/roles/custom/matrix-synapse-admin/tasks/setup_uninstall.yml index 96509874a..3828b7359 100644 --- a/roles/custom/matrix-synapse-admin/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-synapse-admin/tasks/setup_uninstall.yml @@ -13,15 +13,8 @@ state: stopped enabled: false daemon_reload: true - register: stopping_result - name: Ensure matrix-synapse-admin.service doesn't exist ansible.builtin.file: path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-synapse-admin.service" state: absent - - - name: Ensure matrix-synapse-admin Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_synapse_admin_docker_image }}" - state: absent - when: "not matrix_synapse_admin_enabled | bool" diff --git a/roles/custom/matrix-synapse-reverse-proxy-companion/tasks/setup_uninstall.yml b/roles/custom/matrix-synapse-reverse-proxy-companion/tasks/setup_uninstall.yml index f4531a193..bb1b534cf 100644 --- a/roles/custom/matrix-synapse-reverse-proxy-companion/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-synapse-reverse-proxy-companion/tasks/setup_uninstall.yml @@ -13,18 +13,13 @@ state: stopped enabled: false daemon_reload: true - register: stopping_result - name: Ensure matrix-synapse-reverse-proxy-companion.service doesn't exist ansible.builtin.file: path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-synapse-reverse-proxy-companion.service" state: absent - - name: Ensure systemd reloaded after matrix-synapse-reverse-proxy-companion.service removal - ansible.builtin.service: - daemon_reload: true - -- name: Ensure matrix-synapse-reverse-proxy-companion data deleted - ansible.builtin.file: - path: "{{ matrix_synapse_reverse_proxy_companion_base_path }}" - state: absent + - name: Ensure matrix-synapse-reverse-proxy-companion data deleted + ansible.builtin.file: + path: "{{ matrix_synapse_reverse_proxy_companion_base_path }}" + state: absent diff --git a/roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/setup_uninstall.yml b/roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/setup_uninstall.yml index a828070c9..d664d75fc 100644 --- a/roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/setup_uninstall.yml +++ b/roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/setup_uninstall.yml @@ -9,11 +9,6 @@ - matrix-synapse-s3-storage-provider-migrate.service register: matrix_synapse_s3_storage_provider_migrate_sevice_removal -- name: Ensure systemd reloaded after matrix-synapse-s3-storage-provider-migrate.service removal - ansible.builtin.service: - daemon_reload: true - when: matrix_synapse_s3_storage_provider_migrate_sevice_removal.changed | bool - - name: Ensure s3-storage-provider files don't exist ansible.builtin.file: path: "{{ item }}" diff --git a/roles/custom/matrix-synapse/tasks/goofys/setup_uninstall.yml b/roles/custom/matrix-synapse/tasks/goofys/setup_uninstall.yml index ddfa5cf60..252877dee 100644 --- a/roles/custom/matrix-synapse/tasks/goofys/setup_uninstall.yml +++ b/roles/custom/matrix-synapse/tasks/goofys/setup_uninstall.yml @@ -5,32 +5,21 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-goofys.service" register: matrix_goofys_service_stat -- name: Ensure matrix-goofys is stopped - ansible.builtin.service: - name: matrix-goofys - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_goofys_service_stat.stat.exists" +- when: matrix_goofys_service_stat.stat.exists | bool + block: + - name: Ensure matrix-goofys is stopped + ansible.builtin.service: + name: matrix-goofys + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-goofys.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-goofys.service" - state: absent - when: "matrix_goofys_service_stat.stat.exists" + - name: Ensure matrix-goofys.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-goofys.service" + state: absent -- name: Ensure systemd reloaded after matrix-goofys.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_goofys_service_stat.stat.exists" - -- name: Ensure goofys environment variables file doesn't exist - ansible.builtin.file: - path: "{{ matrix_synapse_config_dir_path }}/env-goofys" - state: absent - -- name: Ensure Goofys Docker image doesn't exist - community.docker.docker_image: - name: "{{ matrix_s3_goofys_docker_image }}" - state: absent + - name: Ensure goofys environment variables file doesn't exist + ansible.builtin.file: + path: "{{ matrix_synapse_config_dir_path }}/env-goofys" + state: absent diff --git a/roles/custom/matrix-synapse/tasks/synapse/setup_uninstall.yml b/roles/custom/matrix-synapse/tasks/synapse/setup_uninstall.yml index 17fa8a4fa..7f0815224 100644 --- a/roles/custom/matrix-synapse/tasks/synapse/setup_uninstall.yml +++ b/roles/custom/matrix-synapse/tasks/synapse/setup_uninstall.yml @@ -5,36 +5,22 @@ path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-synapse.service" register: matrix_synapse_service_stat -- name: Ensure matrix-synapse is stopped - ansible.builtin.service: - name: matrix-synapse - state: stopped - enabled: false - daemon_reload: true - register: stopping_result - when: "matrix_synapse_service_stat.stat.exists" +- when: matrix_synapse_service_stat.stat.exists | bool + block: + - name: Ensure matrix-synapse is stopped + ansible.builtin.service: + name: matrix-synapse + state: stopped + enabled: false + daemon_reload: true -- name: Ensure matrix-synapse.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-synapse.service" - state: absent - when: "matrix_synapse_service_stat.stat.exists" + - name: Ensure matrix-synapse.service doesn't exist + ansible.builtin.file: + path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-synapse.service" + state: absent -- name: Ensure systemd reloaded after matrix-synapse.service removal - ansible.builtin.service: - daemon_reload: true - when: "matrix_synapse_service_stat.stat.exists" - -- name: Ensure Synapse Docker image doesn't exist - community.docker.docker_image: - name: "{{ item }}" - state: absent - with_items: - - "{{ matrix_synapse_docker_image_final }}" - - "{{ matrix_synapse_docker_image }}" - -- name: Ensure sample prometheus.yml for external scraping is deleted - ansible.builtin.file: - path: "{{ matrix_synapse_base_path }}/external_prometheus.yml.example" - state: absent - when: "not matrix_synapse_metrics_proxying_enabled | bool" + - name: Ensure sample prometheus.yml for external scraping is deleted + ansible.builtin.file: + path: "{{ matrix_synapse_base_path }}/external_prometheus.yml.example" + state: absent + when: "not matrix_synapse_metrics_proxying_enabled | bool"