Disable systemd services when stopping to uninstall them

Until now, we were leaving services "enabled"
(symlinks in /etc/systemd/system/multi-user.target.wants/).

We clean these up now. Broken symlinks may still exist in older
installations that enabled/disabled services. We're not taking care
to fix these up. It's just a cosmetic defect anyway.
This commit is contained in:
Slavi Pantaleev 2021-11-10 17:39:21 +02:00
parent f5fd9661fa
commit 735c966ab6
65 changed files with 68 additions and 2 deletions

View file

@ -9,6 +9,7 @@
service:
name: matrix-bot-go-neb
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "matrix_bot_go_neb_service_stat.stat.exists|bool"

View file

@ -9,6 +9,7 @@
service:
name: matrix-bot-matrix-reminder-bot
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists|bool"

View file

@ -9,6 +9,7 @@
service:
name: matrix-bot-mjolnir
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "matrix_bot_mjolnir_service_stat.stat.exists|bool"

View file

@ -54,6 +54,7 @@
service:
name: matrix-appservice-discord
state: stopped
enabled: no
daemon_reload: yes
failed_when: false
when: "matrix_appservice_discord_stat_db.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-appservice-discord
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_appservice_discord_service_stat.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-appservice-irc
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_appservice_irc_service_stat.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-appservice-slack
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_appservice_slack_service_stat.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-appservice-webhooks
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_appservice_webhooks_service_stat.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-beeper-linkedin
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_beeper_linkedin_service_stat.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-heisenbridge
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_heisenbridge_service_stat.stat.exists"

View file

@ -86,6 +86,7 @@
service:
name: matrix-mautrix-facebook
state: stopped
enabled: no
daemon_reload: yes
failed_when: false
when: "matrix_mautrix_facebook_stat_database.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-mautrix-facebook
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_mautrix_facebook_service_stat.stat.exists"

View file

@ -85,6 +85,7 @@
service:
name: matrix-mautrix-googlechat
state: stopped
enabled: no
daemon_reload: yes
failed_when: false
when: "matrix_mautrix_googlechat_stat_database.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-mautrix-googlechat
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_mautrix_googlechat_service_stat.stat.exists"

View file

@ -85,6 +85,7 @@
service:
name: matrix-mautrix-hangouts
state: stopped
enabled: no
daemon_reload: yes
failed_when: false
when: "matrix_mautrix_hangouts_stat_database.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-mautrix-hangouts
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_mautrix_hangouts_service_stat.stat.exists"

View file

@ -8,6 +8,7 @@
service:
name: matrix-mautrix-instagram
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_mautrix_instagram_service_stat.stat.exists"

View file

@ -10,6 +10,7 @@
service:
name: matrix-mautrix-signal-daemon
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_mautrix_signal_daemon_service_stat.stat.exists"
@ -29,6 +30,7 @@
service:
name: matrix-mautrix-signal
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_mautrix_signal_service_stat.stat.exists"

View file

@ -107,6 +107,7 @@
service:
name: matrix-mautrix-telegram
state: stopped
enabled: no
daemon_reload: yes
failed_when: false
when: "matrix_mautrix_telegram_stat_database.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-mautrix-telegram
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_mautrix_telegram_service_stat.stat.exists"

View file

@ -93,6 +93,7 @@
service:
name: matrix-mautrix-whatsapp
state: stopped
enabled: no
daemon_reload: yes
failed_when: false
when: "matrix_mautrix_whatsapp_stat_database.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-mautrix-whatsapp
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_mautrix_whatsapp_service_stat.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-mx-puppet-discord
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_mx_puppet_discord_service_stat.stat.exists"

View file

@ -31,6 +31,7 @@
service:
name: matrix-mx-puppet-groupme
state: stopped
enabled: no
daemon_reload: yes
failed_when: false
when: "matrix_mx_puppet_groupme_stat_database.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-mx-puppet-groupme
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_mx_puppet_groupme_service_stat.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-mx-puppet-instagram
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_mx_puppet_instagram_service_stat.stat.exists"

View file

@ -31,6 +31,7 @@
service:
name: matrix-mx-puppet-skype
state: stopped
enabled: no
daemon_reload: yes
failed_when: false
when: "matrix_mx_puppet_skype_stat_database.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-mx-puppet-skype
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_mx_puppet_skype_service_stat.stat.exists"

View file

@ -31,6 +31,7 @@
service:
name: matrix-mx-puppet-slack
state: stopped
enabled: no
daemon_reload: yes
failed_when: false
when: "matrix_mx_puppet_slack_stat_database.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-mx-puppet-slack
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_mx_puppet_slack_service_stat.stat.exists"

View file

@ -31,6 +31,7 @@
service:
name: matrix-mx-puppet-steam
state: stopped
enabled: no
daemon_reload: yes
failed_when: false
when: "matrix_mx_puppet_steam_stat_database.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-mx-puppet-steam
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_mx_puppet_steam_service_stat.stat.exists"

View file

@ -31,6 +31,7 @@
service:
name: matrix-mx-puppet-twitter
state: stopped
enabled: no
daemon_reload: yes
failed_when: false
when: "matrix_mx_puppet_twitter_stat_database.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-mx-puppet-twitter
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_mx_puppet_twitter_service_stat.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-sms-bridge
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_sms_bridge_service_stat.stat.exists"
@ -16,4 +17,4 @@
file:
path: "{{ matrix_systemd_path }}/matrix-sms-bridge.service"
state: absent
when: "matrix_sms_bridge_service_stat.stat.exists"
when: "matrix_sms_bridge_service_stat.stat.exists"

View file

@ -10,6 +10,7 @@
service:
name: matrix-riot-web
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "matrix_client_element_enabled|bool and matrix_client_riot_web_service_stat.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-client-element
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "matrix_client_element_service_stat.stat.exists|bool"

View file

@ -9,6 +9,7 @@
service:
name: matrix-client-hydrogen
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "matrix_client_hydrogen_service_stat.stat.exists|bool"

View file

@ -83,6 +83,7 @@
service:
name: matrix-corporal
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "not matrix_corporal_enabled|bool and matrix_corporal_service_stat.stat.exists"

View file

@ -10,6 +10,7 @@
service:
name: matrix-coturn
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_coturn_service_stat.stat.exists|bool"
@ -17,6 +18,7 @@
service:
name: matrix-coturn
state: stopped
enabled: no
daemon_reload: yes
failed_when: false
when: "matrix_coturn_service_stat.stat.exists|bool"

View file

@ -9,6 +9,7 @@
service:
name: matrix-dimension
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "matrix_dimension_service_stat.stat.exists|bool"

View file

@ -9,6 +9,7 @@
service:
name: matrix-dynamic-dns
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_dynamic_dns_service_stat.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-email2matrix
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "matrix_email2matrix_service_stat.stat.exists|bool"

View file

@ -9,6 +9,7 @@
service:
name: matrix-etherpad
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "matrix_etherpad_service_stat.stat.exists|bool"

View file

@ -93,6 +93,7 @@
service:
name: matrix-grafana
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "not matrix_grafana_enabled|bool and matrix_grafana_service_stat.stat.exists"

View file

@ -68,6 +68,7 @@
service:
name: matrix-jitsi-jicofo
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "not matrix_jitsi_enabled|bool and matrix_jitsi_jicofo_service_stat.stat.exists"

View file

@ -68,6 +68,7 @@
service:
name: matrix-jitsi-jvb
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "not matrix_jitsi_enabled|bool and matrix_jitsi_jvb_service_stat.stat.exists"

View file

@ -59,6 +59,7 @@
service:
name: matrix-jitsi-prosody
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "not matrix_jitsi_enabled|bool and matrix_jitsi_prosody_service_stat.stat.exists"

View file

@ -69,6 +69,7 @@
service:
name: matrix-jitsi-web
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "not matrix_jitsi_enabled|bool and matrix_jitsi_web_service_stat.stat.exists"

View file

@ -23,6 +23,7 @@
service:
name: matrix-mxisd
state: stopped
enabled: no
daemon_reload: yes
when: "matrix_mxisd_service_stat.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-ma1sd
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "matrix_ma1sd_service_stat.stat.exists|bool"

View file

@ -79,6 +79,7 @@
service:
name: matrix-mailer
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "not matrix_mailer_enabled|bool and matrix_mailer_service_stat.stat.exists"

View file

@ -193,6 +193,7 @@
service:
name: matrix-nginx-proxy
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "not matrix_nginx_proxy_enabled|bool and matrix_nginx_proxy_service_stat.stat.exists"

View file

@ -69,6 +69,7 @@
service:
name: matrix-postgres-backup
state: stopped
enabled: no
daemon_reload: yes
when: "not matrix_postgres_backup_enabled|bool and matrix_postgres_backup_service_stat.stat.exists"

View file

@ -69,4 +69,4 @@
- name: Ensure systemd reloaded after getting rid of outdated matrix-postgres.service
service:
daemon_reload: yes
when: "result_pg_old_data_dir_stat.stat.exists"
when: "result_pg_old_data_dir_stat.stat.exists"

View file

@ -38,6 +38,7 @@
service:
name: matrix-prometheus-node-exporter
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "not matrix_prometheus_node_exporter_enabled|bool and matrix_prometheus_node_exporter_service_stat.stat.exists"

View file

@ -38,6 +38,7 @@
service:
name: matrix-prometheus-postgres-exporter
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "not matrix_prometheus_postgres_exporter_enabled|bool and matrix_prometheus_postgres_exporter_service_stat.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-prometheus
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "matrix_prometheus_service_stat.stat.exists|bool"

View file

@ -72,6 +72,7 @@
service:
name: matrix-redis
state: stopped
enabled: no
daemon_reload: yes
when: "not matrix_redis_enabled|bool and matrix_redis_service_stat.stat.exists"

View file

@ -9,6 +9,7 @@
service:
name: matrix-registration
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "matrix_registration_service_stat.stat.exists|bool"

View file

@ -9,6 +9,7 @@
service:
name: matrix-sygnal
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "matrix_sygnal_service_stat.stat.exists|bool"

View file

@ -59,6 +59,7 @@
service:
name: matrix-synapse-admin
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "not matrix_synapse_admin_enabled|bool and matrix_synapse_admin_service_stat.stat.exists"

View file

@ -7,6 +7,7 @@
service:
name: matrix-goofys
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "matrix_goofys_service_stat.stat.exists"

View file

@ -44,6 +44,7 @@
service:
name: matrix-synapse
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result

View file

@ -7,6 +7,7 @@
service:
name: matrix-synapse
state: stopped
enabled: no
daemon_reload: yes
register: stopping_result
when: "matrix_synapse_service_stat.stat.exists"