Add conditional restart support to client, bot, and bridge roles
For each of the 34 roles (3 clients, 9 bots, 22 bridges), this commit: - Adds `_restart_necessary: false` default variable - Adds `register:` directives to config/image/systemd tasks - Computes `_restart_necessary` via set_fact (OR of all .changed results) - Wires `(_restart_necessary | bool)` in group_vars/matrix_servers This allows the systemd service manager to skip unnecessary restarts when running install-* tags and nothing actually changed. Service roles and complex multi-service roles will follow separately. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -304,70 +304,70 @@ devture_systemd_service_manager_services_list_auto: |
|
||||
([{
|
||||
'name': 'matrix-bot-buscarron.service',
|
||||
'priority': 2200,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_bot_buscarron_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bots', 'buscarron', 'bot-buscarron'],
|
||||
}] if matrix_bot_buscarron_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-bot-baibot.service',
|
||||
'priority': 2200,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_bot_baibot_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bots', 'baibot', 'bot-baibot'],
|
||||
}] if matrix_bot_baibot_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-bot-go-neb.service',
|
||||
'priority': 2200,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_bot_go_neb_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bots', 'go-neb', 'bot-go-neb'],
|
||||
}] if matrix_bot_go_neb_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-bot-honoroit.service',
|
||||
'priority': 2200,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_bot_honoroit_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bots', 'honoroit', 'bot-honoroit'],
|
||||
}] if matrix_bot_honoroit_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-bot-matrix-registration-bot.service',
|
||||
'priority': 2200,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_bot_matrix_registration_bot_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bots', 'registration-bot', 'bot-matrix-registration-bot'],
|
||||
}] if matrix_bot_matrix_registration_bot_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-bot-matrix-reminder-bot.service',
|
||||
'priority': 2200,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_bot_matrix_reminder_bot_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bots', 'reminder-bot', 'bot-matrix-reminder-bot'],
|
||||
}] if matrix_bot_matrix_reminder_bot_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-bot-maubot.service',
|
||||
'priority': 2200,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_bot_maubot_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bots', 'maubot', 'bot-maubot'],
|
||||
}] if matrix_bot_maubot_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-bot-mjolnir.service',
|
||||
'priority': 4000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_bot_mjolnir_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bots', 'mjolnir', 'bot-mjolnir'],
|
||||
}] if matrix_bot_mjolnir_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-bot-draupnir.service',
|
||||
'priority': 4000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_bot_draupnir_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bots', 'draupnir', 'bot-draupnir'],
|
||||
}] if matrix_bot_draupnir_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-appservice-discord.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_appservice_discord_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'appservice-discord'],
|
||||
}] if matrix_appservice_discord_enabled else [])
|
||||
+
|
||||
@@ -381,7 +381,7 @@ devture_systemd_service_manager_services_list_auto: |
|
||||
([{
|
||||
'name': 'matrix-appservice-irc.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_appservice_irc_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'appservice-irc'],
|
||||
}] if matrix_appservice_irc_enabled else [])
|
||||
+
|
||||
@@ -402,14 +402,14 @@ devture_systemd_service_manager_services_list_auto: |
|
||||
([{
|
||||
'name': 'matrix-appservice-slack.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_appservice_slack_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'appservice-slack'],
|
||||
}] if matrix_appservice_slack_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-beeper-linkedin.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_beeper_linkedin_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'beeper-linkedin'],
|
||||
}] if matrix_beeper_linkedin_enabled else [])
|
||||
+
|
||||
@@ -430,91 +430,91 @@ devture_systemd_service_manager_services_list_auto: |
|
||||
([{
|
||||
'name': 'matrix-heisenbridge.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_heisenbridge_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'heisenbridge'],
|
||||
}] if matrix_heisenbridge_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-hookshot.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_hookshot_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'hookshot', 'bridge-hookshot'],
|
||||
}] if matrix_hookshot_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-mautrix-bluesky.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_mautrix_bluesky_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'mautrix-bluesky'],
|
||||
}] if matrix_mautrix_bluesky_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-mautrix-discord.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_mautrix_discord_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'mautrix-discord'],
|
||||
}] if matrix_mautrix_discord_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-mautrix-slack.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_mautrix_slack_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'mautrix-slack'],
|
||||
}] if matrix_mautrix_slack_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-mautrix-googlechat.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_mautrix_googlechat_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'mautrix-googlechat'],
|
||||
}] if matrix_mautrix_googlechat_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-mautrix-signal.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_mautrix_signal_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'mautrix-signal', 'mautrix-signal'],
|
||||
}] if matrix_mautrix_signal_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': (matrix_mautrix_meta_messenger_identifier + '.service'),
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_mautrix_meta_messenger_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'mautrix-meta', 'mautrix-meta-messenger'],
|
||||
}] if matrix_mautrix_meta_messenger_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': (matrix_mautrix_meta_instagram_identifier + '.service'),
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_mautrix_meta_instagram_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'mautrix-meta', 'mautrix-meta-instagram'],
|
||||
}] if matrix_mautrix_meta_instagram_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-mautrix-telegram.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_mautrix_telegram_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'mautrix-telegram'],
|
||||
}] if matrix_mautrix_telegram_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-mautrix-twitter.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_mautrix_twitter_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'mautrix-twitter'],
|
||||
}] if matrix_mautrix_twitter_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-mautrix-gmessages.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_mautrix_gmessages_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'mautrix-gmessages'],
|
||||
}] if matrix_mautrix_gmessages_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-mautrix-whatsapp.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_mautrix_whatsapp_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'mautrix-whatsapp'],
|
||||
}] if matrix_mautrix_whatsapp_enabled else [])
|
||||
+
|
||||
@@ -535,35 +535,35 @@ devture_systemd_service_manager_services_list_auto: |
|
||||
([{
|
||||
'name': 'matrix-mx-puppet-groupme.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_mx_puppet_groupme_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'mx-puppet-groupme'],
|
||||
}] if matrix_mx_puppet_groupme_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-mx-puppet-steam.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_mx_puppet_steam_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'mx-puppet-steam'],
|
||||
}] if matrix_mx_puppet_steam_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-postmoogle.service',
|
||||
'priority': 2200,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_postmoogle_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'postmoogle'],
|
||||
}] if matrix_postmoogle_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-sms-bridge.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_sms_bridge_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'sms'],
|
||||
}] if matrix_sms_bridge_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-steam-bridge.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_steam_bridge_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'matrix-steam-bridge'],
|
||||
}] if matrix_steam_bridge_enabled else [])
|
||||
+
|
||||
@@ -591,7 +591,7 @@ devture_systemd_service_manager_services_list_auto: |
|
||||
([{
|
||||
'name': 'matrix-client-element.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_client_element_restart_necessary | bool),
|
||||
'groups': ['matrix', 'clients', 'element', 'client-element'],
|
||||
}] if matrix_client_element_enabled else [])
|
||||
+
|
||||
@@ -605,14 +605,14 @@ devture_systemd_service_manager_services_list_auto: |
|
||||
([{
|
||||
'name': 'matrix-client-schildichat.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_client_schildichat_restart_necessary | bool),
|
||||
'groups': ['matrix', 'clients', 'schildichat', 'client-schildichat'],
|
||||
}] if matrix_client_schildichat_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-client-fluffychat.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': true,
|
||||
'restart_necessary': (matrix_client_fluffychat_restart_necessary | bool),
|
||||
'groups': ['matrix', 'clients', 'fluffychat', 'client-fluffychat'],
|
||||
}] if matrix_client_fluffychat_enabled else [])
|
||||
+
|
||||
|
||||
Reference in New Issue
Block a user