Remove some hardcoded matrix-postgres references

This commit is contained in:
Slavi Pantaleev
2022-11-27 08:23:43 +02:00
parent 04b9483f0d
commit eedf5ad94d
23 changed files with 80 additions and 59 deletions

View File

@ -43,7 +43,7 @@ matrix_bot_honoroit_sqlite_database_path_in_container: "/data/bot.db"
matrix_bot_honoroit_database_username: 'honoroit'
matrix_bot_honoroit_database_password: 'some-password'
matrix_bot_honoroit_database_hostname: 'matrix-postgres'
matrix_bot_honoroit_database_hostname: ''
matrix_bot_honoroit_database_port: 5432
matrix_bot_honoroit_database_name: 'honoroit'

View File

@ -1,10 +1,11 @@
---
- name: Fail if required settings not defined
- name: Fail if required honoroit settings not defined
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`).
when: "vars[item] == ''"
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and vars[item.name] == ''"
with_items:
- "matrix_bot_honoroit_password"
- "matrix_bot_honoroit_roomid"
- {'name': 'matrix_bot_honoroit_password', when: true}
- {'name': 'matrix_bot_honoroit_roomid', when: true}
- {'name': 'matrix_bot_honoroit_database_hostname', when: "{{ matrix_bot_honoroit_database_engine == 'postgres' }}"}

View File

@ -44,7 +44,7 @@ matrix_bot_matrix_reminder_bot_sqlite_database_path_in_container: "/data/bot.db"
matrix_bot_matrix_reminder_bot_database_username: 'matrix_reminder_bot'
matrix_bot_matrix_reminder_bot_database_password: 'some-password'
matrix_bot_matrix_reminder_bot_database_hostname: 'matrix-postgres'
matrix_bot_matrix_reminder_bot_database_hostname: ''
matrix_bot_matrix_reminder_bot_database_port: 5432
matrix_bot_matrix_reminder_bot_database_name: 'matrix_reminder_bot'

View File

@ -1,15 +1,16 @@
---
- name: Fail if required settings not defined
- name: Fail if required matrix-reminder-bot settings not defined
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`).
when: "vars[item] == ''"
when: "item.when | bool and vars[item.name] == ''"
with_items:
- "matrix_bot_matrix_reminder_bot_matrix_user_password"
- "matrix_bot_matrix_reminder_bot_reminders_timezone"
- {'name': 'matrix_bot_matrix_reminder_bot_matrix_user_password', when: true}
- {'name': 'matrix_bot_matrix_reminder_bot_reminders_timezone', when: true}
- {'name': 'matrix_bot_matrix_reminder_bot_database_hostname', when: "{{ matrix_bot_matrix_reminder_bot_database_engine == 'postgres' }}"}
- name: (Deprecation) Catch and report renamed settings
- name: (Deprecation) Catch and report renamed matrix-reminder-bot settings
ansible.builtin.fail:
msg: >-
Your configuration contains a variable, which now has a different name.

View File

@ -27,7 +27,7 @@ matrix_bot_maubot_sqlite_database_path_in_container: "/data/maubot.db"
matrix_bot_maubot_database_username: matrix_bot_maubot
matrix_bot_maubot_database_password: ~
matrix_bot_maubot_database_hostname: 'matrix-postgres'
matrix_bot_maubot_database_hostname: ''
matrix_bot_maubot_database_port: 5432
matrix_bot_maubot_database_name: matrix_bot_maubot

View File

@ -1,10 +1,11 @@
---
- name: Fail if required settings not defined
- name: Fail if required maubot settings not defined
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`).
when: "vars[item] == ''"
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and vars[item.name] == ''"
with_items:
- matrix_bot_maubot_unshared_secret
- matrix_bot_maubot_admins
- {'name': 'matrix_bot_maubot_unshared_secret', when: true}
- {'name': 'matrix_bot_maubot_admins', when: true}
- {'name': 'matrix_bot_maubot_database_hostname', when: "{{ matrix_bot_maubot_database_engine == 'postgres' }}"}

View File

@ -1,6 +1,6 @@
---
- name: Fail if required settings not defined
- name: Fail if required mautrix-twitter settings not defined
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`).

View File

@ -66,7 +66,7 @@ matrix_mx_puppet_discord_sqlite_database_path_in_container: "/data/database.db"
matrix_mx_puppet_discord_database_username: matrix_mx_puppet_discord
matrix_mx_puppet_discord_database_password: ~
matrix_mx_puppet_discord_database_hostname: 'matrix-postgres'
matrix_mx_puppet_discord_database_hostname: ''
matrix_mx_puppet_discord_database_port: 5432
matrix_mx_puppet_discord_database_name: matrix_mx_puppet_discord

View File

@ -1,10 +1,11 @@
---
- name: Fail if required settings not defined
- name: Fail if required mx-puppet-discord settings not defined
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`).
when: "vars[item] == ''"
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and vars[item.name] == ''"
with_items:
- "matrix_mx_puppet_discord_appservice_token"
- "matrix_mx_puppet_discord_homeserver_token"
- {'name': 'matrix_mx_puppet_discord_appservice_token', when: true}
- {'name': 'matrix_mx_puppet_discord_homeserver_token', when: true}
- {'name': 'matrix_mx_puppet_discord_database_hostname', when: "{{ matrix_mx_puppet_discord_database_engine == 'postgres' }}"}

View File

@ -62,7 +62,7 @@ matrix_mx_puppet_groupme_sqlite_database_path_in_container: "/data/database.db"
matrix_mx_puppet_groupme_database_username: matrix_mx_puppet_groupme
matrix_mx_puppet_groupme_database_password: ~
matrix_mx_puppet_groupme_database_hostname: 'matrix-postgres'
matrix_mx_puppet_groupme_database_hostname: ''
matrix_mx_puppet_groupme_database_port: 5432
matrix_mx_puppet_groupme_database_name: matrix_mx_puppet_groupme

View File

@ -1,10 +1,11 @@
---
- name: Fail if required settings not defined
- name: Fail if required mx-puppet-groupme settings not defined
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`).
when: "vars[item] == ''"
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and vars[item.name] == ''"
with_items:
- "matrix_mx_puppet_groupme_appservice_token"
- "matrix_mx_puppet_groupme_homeserver_token"
- {'name': 'matrix_mx_puppet_groupme_appservice_token', when: true}
- {'name': 'matrix_mx_puppet_groupme_homeserver_token', when: true}
- {'name': 'matrix_mx_puppet_groupme_database_hostname', when: "{{ matrix_mx_puppet_groupme_database_engine == 'postgres' }}"}

View File

@ -56,7 +56,7 @@ matrix_mx_puppet_instagram_sqlite_database_path_in_container: "/data/database.db
matrix_mx_puppet_instagram_database_username: matrix_mx_puppet_instagram
matrix_mx_puppet_instagram_database_password: ~
matrix_mx_puppet_instagram_database_hostname: 'matrix-postgres'
matrix_mx_puppet_instagram_database_hostname: ''
matrix_mx_puppet_instagram_database_port: 5432
matrix_mx_puppet_instagram_database_name: matrix_mx_puppet_instagram

View File

@ -1,10 +1,11 @@
---
- name: Fail if required settings not defined
- name: Fail if required mx-puppet-instagram settings not defined
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`).
when: "vars[item] == ''"
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and vars[item.name] == ''"
with_items:
- "matrix_mx_puppet_instagram_appservice_token"
- "matrix_mx_puppet_instagram_homeserver_token"
- {'name': 'matrix_mx_puppet_instagram_appservice_token', when: true}
- {'name': 'matrix_mx_puppet_instagram_homeserver_token', when: true}
- {'name': 'matrix_mx_puppet_instagram_database_hostname', when: "{{ matrix_mx_puppet_instagram_database_engine == 'postgres' }}"}

View File

@ -70,7 +70,7 @@ matrix_mx_puppet_slack_sqlite_database_path_in_container: "/data/database.db"
matrix_mx_puppet_slack_database_username: matrix_mx_puppet_slack
matrix_mx_puppet_slack_database_password: ~
matrix_mx_puppet_slack_database_hostname: 'matrix-postgres'
matrix_mx_puppet_slack_database_hostname: ''
matrix_mx_puppet_slack_database_port: 5432
matrix_mx_puppet_slack_database_name: matrix_mx_puppet_slack

View File

@ -1,10 +1,11 @@
---
- name: Fail if required settings not defined
- name: Fail if required mx-puppet-slack settings not defined
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`).
when: "vars[item] == ''"
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and vars[item.name] == ''"
with_items:
- "matrix_mx_puppet_slack_appservice_token"
- "matrix_mx_puppet_slack_homeserver_token"
- {'name': 'matrix_mx_puppet_slack_appservice_token', when: true}
- {'name': 'matrix_mx_puppet_slack_homeserver_token', when: true}
- {'name': 'matrix_mx_puppet_slack_database_hostname', when: "{{ matrix_mx_puppet_slack_database_engine == 'postgres' }}"}

View File

@ -62,7 +62,7 @@ matrix_mx_puppet_steam_sqlite_database_path_in_container: "/data/database.db"
matrix_mx_puppet_steam_database_username: matrix_mx_puppet_steam
matrix_mx_puppet_steam_database_password: ~
matrix_mx_puppet_steam_database_hostname: 'matrix-postgres'
matrix_mx_puppet_steam_database_hostname: ''
matrix_mx_puppet_steam_database_port: 5432
matrix_mx_puppet_steam_database_name: matrix_mx_puppet_steam

View File

@ -1,10 +1,11 @@
---
- name: Fail if required settings not defined
- name: Fail if required mx-puppet-steam settings not defined
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`).
when: "vars[item] == ''"
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and vars[item.name] == ''"
with_items:
- "matrix_mx_puppet_steam_appservice_token"
- "matrix_mx_puppet_steam_homeserver_token"
- {'name': 'matrix_mx_puppet_steam_appservice_token', when: true}
- {'name': 'matrix_mx_puppet_steam_homeserver_token', when: true}
- {'name': 'matrix_mx_puppet_steam_database_hostname', when: "{{ matrix_mx_puppet_steam_database_engine == 'postgres' }}"}

View File

@ -71,7 +71,7 @@ matrix_mx_puppet_twitter_sqlite_database_path_in_container: "/data/database.db"
matrix_mx_puppet_twitter_database_username: mx_puppet_twitter
matrix_mx_puppet_twitter_database_password: ~
matrix_mx_puppet_twitter_database_hostname: 'matrix-postgres'
matrix_mx_puppet_twitter_database_hostname: ''
matrix_mx_puppet_twitter_database_port: 5432
matrix_mx_puppet_twitter_database_name: matrix_mx_puppet_twitter

View File

@ -1,10 +1,11 @@
---
- name: Fail if required settings not defined
- name: Fail if required mx-puppet-twitter settings not defined
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`).
when: "vars[item] == ''"
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and vars[item.name] == ''"
with_items:
- "matrix_mx_puppet_twitter_appservice_token"
- "matrix_mx_puppet_twitter_homeserver_token"
- {'name': 'matrix_mx_puppet_twitter_appservice_token', when: true}
- {'name': 'matrix_mx_puppet_twitter_homeserver_token', when: true}
- {'name': 'matrix_mx_puppet_twitter_database_hostname', when: "{{ matrix_mx_puppet_twitter_database_engine == 'postgres' }}"}

View File

@ -138,7 +138,7 @@ matrix_dendrite_metrics_password: "metrics"
# Postgres database information
matrix_dendrite_database_str: "postgresql://{{ matrix_dendrite_database_user }}:{{ matrix_dendrite_database_password }}@{{ matrix_dendrite_database_hostname }}"
matrix_dendrite_database_hostname: "matrix-postgres"
matrix_dendrite_database_hostname: ''
matrix_dendrite_database_user: "dendrite"
matrix_dendrite_database_password: "itsasecret"
matrix_dendrite_federationapi_database: "dendrite_federationapi"

View File

@ -5,7 +5,8 @@
You need to define a required configuration setting (`{{ item }}`) for using Dendrite.
when: "vars[item] == ''"
with_items:
- "matrix_dendrite_client_api_registration_shared_secret"
- matrix_dendrite_client_api_registration_shared_secret
- matrix_dendrite_database_hostname
- name: (Deprecation) Catch and report renamed settings
ansible.builtin.fail:

View File

@ -16,8 +16,8 @@ Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} kill matrix-dendrite 2>/dev/null || true'
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-dendrite 2>/dev/null || true'
{% if 'matrix-postgres.service' in matrix_dendrite_systemd_required_services_list %}
# Dendrite is too quick to start in relation to its matrix-postgres dependency.
{% if (devture_postgres_identifier + '.service') in matrix_dendrite_systemd_required_services_list %}
# Dendrite is too quick to start in relation to its Postgres dependency.
# Delay Dendrite startup to avoid failing with: "failed to connect to accounts db" ("pq: the database system is starting up").
ExecStartPre={{ matrix_host_command_sleep }} 5
{% endif %}