From 4b111d05d5b23b9df3c80f328b625ddd1e1c92db Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Mon, 28 Nov 2022 07:44:59 +0200 Subject: [PATCH] Pass devture_postgres_db_migration_request to com.devture.ansible.role.postgres in a cleaner way --- .../custom/matrix-bot-buscarron/tasks/setup_install.yml | 9 ++++----- roles/custom/matrix-bot-honoroit/tasks/setup_install.yml | 9 ++++----- .../tasks/setup_install.yml | 9 ++++----- .../custom/matrix-bot-postmoogle/tasks/setup_install.yml | 9 ++++----- .../tasks/setup_install.yml | 9 ++++----- .../tasks/setup_install.yml | 9 ++++----- .../tasks/setup_install.yml | 9 ++++----- .../tasks/setup_install.yml | 9 ++++----- .../tasks/setup_install.yml | 9 ++++----- .../tasks/setup_install.yml | 9 ++++----- .../tasks/setup_install.yml | 9 ++++----- .../tasks/setup_install.yml | 9 ++++----- .../tasks/setup_install.yml | 9 ++++----- .../tasks/setup_install.yml | 9 ++++----- .../tasks/setup_install.yml | 9 ++++----- .../tasks/setup_install.yml | 9 ++++----- .../tasks/setup_install.yml | 9 ++++----- .../tasks/setup_install.yml | 9 ++++----- roles/custom/matrix-dimension/tasks/setup_install.yml | 9 ++++----- roles/custom/matrix-ma1sd/tasks/setup_install.yml | 9 ++++----- roles/custom/matrix-registration/tasks/setup_install.yml | 9 ++++----- 21 files changed, 84 insertions(+), 105 deletions(-) diff --git a/roles/custom/matrix-bot-buscarron/tasks/setup_install.yml b/roles/custom/matrix-bot-buscarron/tasks/setup_install.yml index f255b141..6ae0f9b9 100644 --- a/roles/custom/matrix-bot-buscarron/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-buscarron/tasks/setup_install.yml @@ -11,7 +11,10 @@ - when: "matrix_bot_buscarron_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_bot_buscarron_sqlite_database_path_local }}" dst: "{{ matrix_bot_buscarron_database_connection_string }}" @@ -20,10 +23,6 @@ engine_old: 'sqlite' systemd_services_to_stop: ['matrix-bot-buscarron.service'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_bot_buscarron_requires_restart: true diff --git a/roles/custom/matrix-bot-honoroit/tasks/setup_install.yml b/roles/custom/matrix-bot-honoroit/tasks/setup_install.yml index f71f2416..f7b264a8 100644 --- a/roles/custom/matrix-bot-honoroit/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-honoroit/tasks/setup_install.yml @@ -11,7 +11,10 @@ - when: "matrix_bot_honoroit_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_bot_honoroit_sqlite_database_path_local }}" dst: "{{ matrix_bot_honoroit_database_connection_string }}" @@ -20,10 +23,6 @@ engine_old: 'sqlite' systemd_services_to_stop: ['matrix-bot-honoroit.service'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_bot_honoroit_requires_restart: true diff --git a/roles/custom/matrix-bot-matrix-reminder-bot/tasks/setup_install.yml b/roles/custom/matrix-bot-matrix-reminder-bot/tasks/setup_install.yml index 46633547..39bf63e6 100644 --- a/roles/custom/matrix-bot-matrix-reminder-bot/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-matrix-reminder-bot/tasks/setup_install.yml @@ -12,7 +12,10 @@ - when: "matrix_bot_matrix_reminder_bot_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_bot_matrix_reminder_bot_sqlite_database_path_local }}" dst: "{{ matrix_bot_matrix_reminder_bot_database_connection_string }}" @@ -21,10 +24,6 @@ engine_old: 'sqlite' systemd_services_to_stop: ['matrix-bot-matrix-reminder-bot.service'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_bot_matrix_reminder_bot_requires_restart: true diff --git a/roles/custom/matrix-bot-postmoogle/tasks/setup_install.yml b/roles/custom/matrix-bot-postmoogle/tasks/setup_install.yml index cede2d35..ed2bcc9d 100644 --- a/roles/custom/matrix-bot-postmoogle/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-postmoogle/tasks/setup_install.yml @@ -8,7 +8,10 @@ - when: "matrix_bot_postmoogle_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_bot_postmoogle_sqlite_database_path_local }}" dst: "{{ matrix_bot_postmoogle_database_connection_string }}" @@ -17,10 +20,6 @@ engine_old: 'sqlite' systemd_services_to_stop: ['matrix-bot-postmoogle.service'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_bot_postmoogle_requires_restart: true diff --git a/roles/custom/matrix-bridge-appservice-discord/tasks/setup_install.yml b/roles/custom/matrix-bridge-appservice-discord/tasks/setup_install.yml index bf5ecf42..4a6419ed 100644 --- a/roles/custom/matrix-bridge-appservice-discord/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-appservice-discord/tasks/setup_install.yml @@ -12,7 +12,10 @@ - when: "matrix_appservice_discord_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_appservice_discord_sqlite_database_path_local }}" dst: "{{ matrix_appservice_discord_database_connString }}" @@ -21,10 +24,6 @@ engine_old: 'sqlite' systemd_services_to_stop: ['matrix-appservice-discord.service'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_appservice_discord_requires_restart: true diff --git a/roles/custom/matrix-bridge-go-skype-bridge/tasks/setup_install.yml b/roles/custom/matrix-bridge-go-skype-bridge/tasks/setup_install.yml index fd36600b..6146637f 100644 --- a/roles/custom/matrix-bridge-go-skype-bridge/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-go-skype-bridge/tasks/setup_install.yml @@ -12,7 +12,10 @@ - when: "matrix_go_skype_bridge_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_go_skype_bridge_sqlite_database_path_local }}" dst: "{{ matrix_go_skype_bridge_database_connection_string }}" @@ -22,10 +25,6 @@ systemd_services_to_stop: ['matrix-go-skype-bridge.service'] pgloader_options: ['--with "quote identifiers"'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_go_skype_bridge_requires_restart: true diff --git a/roles/custom/matrix-bridge-mautrix-discord/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-discord/tasks/setup_install.yml index d83101eb..f16422f7 100644 --- a/roles/custom/matrix-bridge-mautrix-discord/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-discord/tasks/setup_install.yml @@ -12,7 +12,10 @@ - when: "matrix_mautrix_discord_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_mautrix_discord_sqlite_database_path_local }}" dst: "{{ matrix_mautrix_discord_database_connection_string }}" @@ -22,10 +25,6 @@ systemd_services_to_stop: ['matrix-mautrix-discord.service'] pgloader_options: ['--with "quote identifiers"'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_mautrix_discord_requires_restart: true diff --git a/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_install.yml index 6e8f62cd..758a5fed 100644 --- a/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_install.yml @@ -12,7 +12,10 @@ - when: "matrix_mautrix_facebook_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_mautrix_facebook_sqlite_database_path_local }}" dst: "{{ matrix_mautrix_facebook_database_connection_string }}" @@ -21,10 +24,6 @@ engine_old: 'sqlite' systemd_services_to_stop: ['matrix-mautrix-facebook.service'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_mautrix_facebook_requires_restart: true diff --git a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml index d3eee66c..c1258471 100644 --- a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml @@ -12,7 +12,10 @@ - when: "matrix_mautrix_googlechat_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_mautrix_googlechat_sqlite_database_path_local }}" dst: "{{ matrix_mautrix_googlechat_database_connection_string }}" @@ -21,10 +24,6 @@ engine_old: 'sqlite' systemd_services_to_stop: ['matrix-mautrix-googlechat.service'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_mautrix_googlechat_requires_restart: true diff --git a/roles/custom/matrix-bridge-mautrix-hangouts/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-hangouts/tasks/setup_install.yml index ee0534af..f8fdb023 100644 --- a/roles/custom/matrix-bridge-mautrix-hangouts/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-hangouts/tasks/setup_install.yml @@ -12,7 +12,10 @@ - when: "matrix_mautrix_hangouts_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_mautrix_hangouts_sqlite_database_path_local }}" dst: "{{ matrix_mautrix_hangouts_database_connection_string }}" @@ -21,10 +24,6 @@ engine_old: 'sqlite' systemd_services_to_stop: ['matrix-mautrix-hangouts.service'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_mautrix_hangouts_requires_restart: true diff --git a/roles/custom/matrix-bridge-mautrix-telegram/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-telegram/tasks/setup_install.yml index 23a092dc..383d4827 100644 --- a/roles/custom/matrix-bridge-mautrix-telegram/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-telegram/tasks/setup_install.yml @@ -12,7 +12,10 @@ - when: "matrix_mautrix_telegram_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_mautrix_telegram_sqlite_database_path_local }}" dst: "{{ matrix_mautrix_telegram_database_connection_string }}" @@ -21,10 +24,6 @@ engine_old: 'sqlite' systemd_services_to_stop: ['matrix-mautrix-telegram.service'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_mautrix_telegram_requires_restart: true diff --git a/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/setup_install.yml index fd961ec1..1cf883c5 100644 --- a/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/setup_install.yml @@ -12,7 +12,10 @@ - when: "matrix_mautrix_whatsapp_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_mautrix_whatsapp_sqlite_database_path_local }}" dst: "{{ matrix_mautrix_whatsapp_database_connection_string }}" @@ -22,10 +25,6 @@ systemd_services_to_stop: ['matrix-mautrix-whatsapp.service'] pgloader_options: ['--with "quote identifiers"'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_mautrix_whatsapp_requires_restart: true diff --git a/roles/custom/matrix-bridge-mx-puppet-discord/tasks/setup_install.yml b/roles/custom/matrix-bridge-mx-puppet-discord/tasks/setup_install.yml index d2cb83c4..8bf19f80 100644 --- a/roles/custom/matrix-bridge-mx-puppet-discord/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mx-puppet-discord/tasks/setup_install.yml @@ -46,7 +46,10 @@ - when: "matrix_mx_puppet_discord_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_mx_puppet_discord_sqlite_database_path_local }}" dst: "{{ matrix_mx_puppet_discord_database_connection_string }}" @@ -55,10 +58,6 @@ engine_old: 'sqlite' systemd_services_to_stop: ['matrix-mx-puppet-discord.service'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_mx_puppet_discord_requires_restart: true diff --git a/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/setup_install.yml b/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/setup_install.yml index b174f0e0..9db25e86 100644 --- a/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/setup_install.yml @@ -44,7 +44,10 @@ - when: "matrix_mx_puppet_groupme_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_mx_puppet_groupme_sqlite_database_path_local }}" dst: "{{ matrix_mx_puppet_groupme_database_connection_string }}" @@ -53,10 +56,6 @@ engine_old: 'sqlite' systemd_services_to_stop: ['matrix-mx-puppet-groupme.service'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_mx_puppet_groupme_requires_restart: true diff --git a/roles/custom/matrix-bridge-mx-puppet-instagram/tasks/setup_install.yml b/roles/custom/matrix-bridge-mx-puppet-instagram/tasks/setup_install.yml index ce3ecc6f..be68d9fc 100644 --- a/roles/custom/matrix-bridge-mx-puppet-instagram/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mx-puppet-instagram/tasks/setup_install.yml @@ -12,7 +12,10 @@ - when: "matrix_mx_puppet_instagram_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_mx_puppet_instagram_sqlite_database_path_local }}" dst: "{{ matrix_mx_puppet_instagram_database_connection_string }}" @@ -21,10 +24,6 @@ engine_old: 'sqlite' systemd_services_to_stop: ['matrix-mx-puppet-instagram.service'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_mx_puppet_instagram_requires_restart: true diff --git a/roles/custom/matrix-bridge-mx-puppet-slack/tasks/setup_install.yml b/roles/custom/matrix-bridge-mx-puppet-slack/tasks/setup_install.yml index e2fb6b51..e75d47e5 100644 --- a/roles/custom/matrix-bridge-mx-puppet-slack/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mx-puppet-slack/tasks/setup_install.yml @@ -40,7 +40,10 @@ - when: "matrix_mx_puppet_slack_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_mx_puppet_slack_sqlite_database_path_local }}" dst: "{{ matrix_mx_puppet_slack_database_connection_string }}" @@ -49,10 +52,6 @@ engine_old: 'sqlite' systemd_services_to_stop: ['matrix-mx-puppet-slack.service'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_mx_puppet_slack_requires_restart: true diff --git a/roles/custom/matrix-bridge-mx-puppet-steam/tasks/setup_install.yml b/roles/custom/matrix-bridge-mx-puppet-steam/tasks/setup_install.yml index 6bf2edc7..ca2de448 100644 --- a/roles/custom/matrix-bridge-mx-puppet-steam/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mx-puppet-steam/tasks/setup_install.yml @@ -44,7 +44,10 @@ - when: "matrix_mx_puppet_steam_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_mx_puppet_steam_sqlite_database_path_local }}" dst: "{{ matrix_mx_puppet_steam_database_connection_string }}" @@ -53,10 +56,6 @@ engine_old: 'sqlite' systemd_services_to_stop: ['matrix-mx-puppet-steam.service'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_mx_puppet_steam_requires_restart: true diff --git a/roles/custom/matrix-bridge-mx-puppet-twitter/tasks/setup_install.yml b/roles/custom/matrix-bridge-mx-puppet-twitter/tasks/setup_install.yml index 71b1b575..a8450205 100644 --- a/roles/custom/matrix-bridge-mx-puppet-twitter/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mx-puppet-twitter/tasks/setup_install.yml @@ -44,7 +44,10 @@ - when: "matrix_mx_puppet_twitter_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_mx_puppet_twitter_sqlite_database_path_local }}" dst: "{{ matrix_mx_puppet_twitter_database_connection_string }}" @@ -53,10 +56,6 @@ engine_old: 'sqlite' systemd_services_to_stop: ['matrix-mx-puppet-twitter.service'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_mx_puppet_twitter_requires_restart: true diff --git a/roles/custom/matrix-dimension/tasks/setup_install.yml b/roles/custom/matrix-dimension/tasks/setup_install.yml index e44cc73f..26617f7a 100644 --- a/roles/custom/matrix-dimension/tasks/setup_install.yml +++ b/roles/custom/matrix-dimension/tasks/setup_install.yml @@ -51,7 +51,10 @@ - {'table': 'dimension_bridges', 'column': 'isEnabled', 'default': ''} - {'table': 'dimension_bridges', 'column': 'isPublic', 'default': ''} - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_dimension_sqlite_database_path_local }}" dst: "{{ matrix_dimension_database_connection_string }}" @@ -63,10 +66,6 @@ additional_psql_statements_list: "{{ matrix_dimension_pgloader_additional_psql_statements_list }}" additional_psql_statements_db_name: "{{ matrix_dimension_database_name }}" - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_dimension_requires_restart: true diff --git a/roles/custom/matrix-ma1sd/tasks/setup_install.yml b/roles/custom/matrix-ma1sd/tasks/setup_install.yml index 492cbf41..6fe20342 100644 --- a/roles/custom/matrix-ma1sd/tasks/setup_install.yml +++ b/roles/custom/matrix-ma1sd/tasks/setup_install.yml @@ -27,7 +27,10 @@ - when: "matrix_ma1sd_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_ma1sd_sqlite_database_path_local }}" dst: "{{ matrix_ma1sd_database_connection_string }}" @@ -37,10 +40,6 @@ systemd_services_to_stop: ['matrix-ma1sd.service'] pgloader_options: ['--with "quote identifiers"'] - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_ma1sd_requires_restart: true diff --git a/roles/custom/matrix-registration/tasks/setup_install.yml b/roles/custom/matrix-registration/tasks/setup_install.yml index a3a4bddc..9278f2ef 100644 --- a/roles/custom/matrix-registration/tasks/setup_install.yml +++ b/roles/custom/matrix-registration/tasks/setup_install.yml @@ -12,7 +12,10 @@ - when: "matrix_registration_sqlite_database_path_local_stat_result.stat.exists | bool" block: - - ansible.builtin.set_fact: + - ansible.builtin.include_role: + name: galaxy/com.devture.ansible.role.postgres + tasks_from: migrate_db_to_postgres + vars: devture_postgres_db_migration_request: src: "{{ matrix_registration_sqlite_database_path_local }}" dst: "{{ matrix_registration_database_connection_string }}" @@ -26,10 +29,6 @@ - ALTER TABLE tokens ALTER COLUMN ex_date TYPE TIMESTAMP WITHOUT TIME ZONE; additional_psql_statements_db_name: "{{ matrix_registration_database_name }}" - - ansible.builtin.include_role: - name: galaxy/com.devture.ansible.role.postgres - tasks_from: migrate_db_to_postgres - - ansible.builtin.set_fact: matrix_registration_requires_restart: true