Remove more hardcoded matrix-postgres references

This commit is contained in:
Slavi Pantaleev
2022-11-27 09:16:18 +02:00
parent 3d5d843418
commit 7b43ef34b7
52 changed files with 294 additions and 244 deletions

View File

@ -39,7 +39,7 @@ matrix_backup_borg_location_source_directories: []
matrix_backup_borg_postgresql_enabled: true
matrix_backup_borg_supported_postgres_versions: ['12', '13', '14']
matrix_backup_borg_postgresql_databases: []
matrix_backup_borg_postgresql_databases_hostname: "matrix-postgres"
matrix_backup_borg_postgresql_databases_hostname: ''
matrix_backup_borg_postgresql_databases_username: "matrix"
matrix_backup_borg_postgresql_databases_password: ""
matrix_backup_borg_postgresql_databases_port: 5432

View File

@ -1,12 +1,13 @@
---
- name: Fail if required settings not defined
- name: Fail if required backup-borg 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_backup_borg_ssh_key_private"
- "matrix_backup_borg_location_repositories"
- {'name': 'matrix_backup_borg_ssh_key_private', when: true}
- {'name': 'matrix_backup_borg_location_repositories', when: true}
- {'name': 'matrix_backup_borg_postgresql_databases_hostname', when: "{{ matrix_backup_borg_postgresql_enabled }}"}
- name: Fail if encryption passphrase is undefined unless repository is unencrypted
ansible.builtin.fail:

View File

@ -43,7 +43,7 @@ matrix_bot_buscarron_sqlite_database_path_in_container: "/data/bot.db"
matrix_bot_buscarron_database_username: 'buscarron'
matrix_bot_buscarron_database_password: 'some-password'
matrix_bot_buscarron_database_hostname: 'matrix-postgres'
matrix_bot_buscarron_database_hostname: ''
matrix_bot_buscarron_database_port: 5432
matrix_bot_buscarron_database_name: 'buscarron'

View File

@ -1,9 +1,10 @@
---
- name: Fail if required settings not defined
- name: Fail if required Buscarron 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_buscarron_password"
- {'name': 'matrix_bot_buscarron_password', when: true}
- {'name': 'matrix_bot_buscarron_database_hostname', when: "{{ matrix_bot_buscarron_database_engine == 'postgres' }}"}

View File

@ -42,7 +42,7 @@ matrix_bot_postmoogle_sqlite_database_path_in_container: "/data/bot.db"
matrix_bot_postmoogle_database_username: 'postmoogle'
matrix_bot_postmoogle_database_password: 'some-password'
matrix_bot_postmoogle_database_hostname: 'matrix-postgres'
matrix_bot_postmoogle_database_hostname: ''
matrix_bot_postmoogle_database_port: 5432
matrix_bot_postmoogle_database_name: 'postmoogle'

View File

@ -1,9 +1,10 @@
---
- name: Fail if required settings not defined
- name: Fail if required Postmoogle 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_postmoogle_password"
- {'name': 'matrix_bot_postmoogle_password', when: true}
- {'name': 'matrix_bot_postmoogle_database_hostname', when: "{{ matrix_bot_postmoogle_database_engine == 'postgres' }}"}

View File

@ -60,7 +60,7 @@ matrix_appservice_discord_sqlite_database_path_in_container: "/data/discord.db"
matrix_appservice_discord_database_username: 'matrix_appservice_discord'
matrix_appservice_discord_database_password: 'some-password'
matrix_appservice_discord_database_hostname: 'matrix-postgres'
matrix_appservice_discord_database_hostname: ''
matrix_appservice_discord_database_port: 5432
matrix_appservice_discord_database_name: 'matrix_appservice_discord'

View File

@ -1,16 +1,17 @@
---
- name: Fail if required settings not defined
- name: Fail if required appservice-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_appservice_discord_client_id"
- "matrix_appservice_discord_bot_token"
- "matrix_appservice_discord_appservice_token"
- "matrix_appservice_discord_homeserver_token"
- "matrix_appservice_discord_homeserver_domain"
- {'name': 'matrix_appservice_discord_client_id', when: true}
- {'name': 'matrix_appservice_discord_bot_token', when: true}
- {'name': 'matrix_appservice_discord_appservice_token', when: true}
- {'name': 'matrix_appservice_discord_homeserver_token', when: true}
- {'name': 'matrix_appservice_discord_homeserver_domain', when: true}
- {'name': 'matrix_appservice_discord_database_hostname', when: "{{ matrix_appservice_discord_database_engine == 'postgres' }}"}
- name: (Deprecation) Catch and report renamed appservice-discord variables
ansible.builtin.fail:

View File

@ -29,8 +29,8 @@ matrix_appservice_irc_appservice_address: 'http://matrix-appservice-irc:9999'
matrix_appservice_irc_database_engine: nedb
matrix_appservice_irc_database_username: matrix_appservice_irc
matrix_appservice_irc_database_password: ~
matrix_appservice_irc_database_hostname: 'matrix-postgres'
matrix_appservice_irc_database_password: 'some-password'
matrix_appservice_irc_database_hostname: ''
matrix_appservice_irc_database_port: 5432
matrix_appservice_irc_database_name: matrix_appservice_irc

View File

@ -3,11 +3,12 @@
- name: Fail if required 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_appservice_irc_appservice_token"
- "matrix_appservice_irc_homeserver_token"
- {'name': 'matrix_appservice_irc_appservice_token', when: true}
- {'name': 'matrix_appservice_irc_homeserver_token', when: true}
- {'name': 'matrix_appservice_irc_database_hostname', when: "{{ matrix_appservice_irc_database_engine == 'postgres' }}"}
# Our base configuration (`matrix_appservice_irc_configuration_yaml`) is not enough to
# let the playbook run without errors.

View File

@ -90,7 +90,7 @@ matrix_appservice_kakaotalk_sqlite_database_path_in_container: "/data/appservice
matrix_appservice_kakaotalk_database_username: 'matrix_appservice_kakaotalk'
matrix_appservice_kakaotalk_database_password: 'some-password'
matrix_appservice_kakaotalk_database_hostname: 'matrix-postgres'
matrix_appservice_kakaotalk_database_hostname: ''
matrix_appservice_kakaotalk_database_port: 5432
matrix_appservice_kakaotalk_database_name: 'matrix_appservice_kakaotalk'

View File

@ -1,10 +1,11 @@
---
- name: Fail if required settings not defined
- name: Fail if required appservice-kakaotalk 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_appservice_kakaotalk_appservice_token"
- "matrix_appservice_kakaotalk_homeserver_token"
- {'name': 'matrix_appservice_kakaotalk_appservice_token', when: true}
- {'name': 'matrix_appservice_kakaotalk_homeserver_token', when: true}
- {'name': 'matrix_appservice_kakaotalk_database_hostname', when: "{{ matrix_appservice_kakaotalk_database_engine == 'postgres' }}"}

View File

@ -57,8 +57,8 @@ matrix_appservice_slack_id_token: ''
matrix_appservice_slack_database_engine: nedb
matrix_appservice_slack_database_username: matrix_appservice_slack
matrix_appservice_slack_database_password: ~
matrix_appservice_slack_database_hostname: 'matrix-postgres'
matrix_appservice_slack_database_password: 'some-passsword'
matrix_appservice_slack_database_hostname: ''
matrix_appservice_slack_database_port: 5432
matrix_appservice_slack_database_name: matrix_appservice_slack

View File

@ -1,16 +1,17 @@
---
- name: Fail if required settings not defined
- name: Fail if required appservice-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_appservice_slack_control_room_id"
- "matrix_appservice_slack_appservice_token"
- "matrix_appservice_slack_homeserver_url"
- "matrix_appservice_slack_homeserver_token"
- "matrix_appservice_slack_id_token"
- {'name': 'matrix_appservice_slack_control_room_id', when: true}
- {'name': 'matrix_appservice_slack_appservice_token', when: true}
- {'name': 'matrix_appservice_slack_homeserver_url', when: true}
- {'name': 'matrix_appservice_slack_homeserver_token', when: true}
- {'name': 'matrix_appservice_slack_id_token', when: true}
- {'name': 'matrix_appservice_slack_database_hostname', when: "{{ matrix_appservice_slack_database_engine == 'postgres' }}"}
- name: (Deprecation) Catch and report renamed settings
ansible.builtin.fail:

View File

@ -55,8 +55,8 @@ matrix_beeper_linkedin_appservice_bot_username: linkedinbot
matrix_beeper_linkedin_database_engine: "postgres"
matrix_beeper_linkedin_database_username: 'matrix_beeper_linkedin'
matrix_beeper_linkedin_database_password: ""
matrix_beeper_linkedin_database_hostname: 'matrix-postgres'
matrix_beeper_linkedin_database_password: 'some-password'
matrix_beeper_linkedin_database_hostname: ''
matrix_beeper_linkedin_database_port: 5432
matrix_beeper_linkedin_database_name: 'matrix_beeper_linkedin'

View File

@ -1,10 +1,11 @@
---
- name: Fail if required settings not defined
- name: Fail if required beeper-linkedin 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_beeper_linkedin_appservice_token"
- "matrix_beeper_linkedin_homeserver_token"
- {'name': 'matrix_beeper_linkedin_appservice_token', when: true}
- {'name': 'matrix_beeper_linkedin_homeserver_token', when: true}
- {'name': 'matrix_beeper_linkedin_database_hostname', when: "{{ matrix_beeper_linkedin_database_engine == 'postgres' }}"}

View File

@ -56,7 +56,7 @@ matrix_go_skype_bridge_sqlite_database_path_in_container: "/data/go-skype-bridge
matrix_go_skype_bridge_database_username: 'matrix_go_skype_bridge'
matrix_go_skype_bridge_database_password: 'some-password'
matrix_go_skype_bridge_database_hostname: 'matrix-postgres'
matrix_go_skype_bridge_database_hostname: ''
matrix_go_skype_bridge_database_port: 5432
matrix_go_skype_bridge_database_name: 'matrix_go_skype_bridge'

View File

@ -1,10 +1,11 @@
---
- name: Fail if required settings not defined
- name: Fail if required go-skype-bridge 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_go_skype_bridge_appservice_token"
- "matrix_go_skype_bridge_homeserver_token"
- {'name': 'matrix_go_skype_bridge_appservice_token', when: true}
- {'name': 'matrix_go_skype_bridge_homeserver_token', when: true}
- {'name': 'matrix_go_skype_bridge_database_hostname', when: "{{ matrix_go_skype_bridge_database_engine == 'postgres' }}"}

View File

@ -67,7 +67,7 @@ matrix_mautrix_discord_sqlite_database_path_in_container: "/data/mautrix-discord
matrix_mautrix_discord_database_username: 'matrix_mautrix_discord'
matrix_mautrix_discord_database_password: 'some-password'
matrix_mautrix_discord_database_hostname: 'matrix-postgres'
matrix_mautrix_discord_database_hostname: ''
matrix_mautrix_discord_database_port: 5432
matrix_mautrix_discord_database_name: 'matrix_mautrix_discord'

View File

@ -1,10 +1,11 @@
---
- name: Fail if required settings not defined
- name: Fail if required mautrix-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_mautrix_discord_appservice_token"
- "matrix_mautrix_discord_homeserver_token"
- {'name': 'matrix_mautrix_discord_appservice_token', when: true}
- {'name': 'matrix_mautrix_discord_homeserver_token', when: true}
- {'name': 'matrix_mautrix_discord_database_hostname', when: "{{ matrix_mautrix_discord_database_engine == 'postgres' }}"}

View File

@ -74,7 +74,7 @@ matrix_mautrix_facebook_sqlite_database_path_in_container: "/data/mautrix-facebo
matrix_mautrix_facebook_database_username: 'matrix_mautrix_facebook'
matrix_mautrix_facebook_database_password: 'some-password'
matrix_mautrix_facebook_database_hostname: 'matrix-postgres'
matrix_mautrix_facebook_database_hostname: ''
matrix_mautrix_facebook_database_port: 5432
matrix_mautrix_facebook_database_name: 'matrix_mautrix_facebook'

View File

@ -1,14 +1,15 @@
---
- name: Fail if required settings not defined
- name: Fail if required mautrix-facebook 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_mautrix_facebook_public_endpoint"
- "matrix_mautrix_facebook_appservice_token"
- "matrix_mautrix_facebook_homeserver_token"
- {'name': 'matrix_mautrix_facebook_public_endpoint', when: true}
- {'name': 'matrix_mautrix_facebook_appservice_token', when: true}
- {'name': 'matrix_mautrix_facebook_homeserver_token', when: true}
- {'name': 'matrix_mautrix_facebook_database_hostname', when: "{{ matrix_mautrix_facebook_database_engine == 'postgres' }}"}
- when: "matrix_mautrix_facebook_database_engine == 'sqlite' and matrix_mautrix_facebook_docker_image.endswith(':da1b4ec596e334325a1589e70829dea46e73064b')"
block:

View File

@ -68,7 +68,7 @@ matrix_mautrix_googlechat_sqlite_database_path_in_container: "/data/mautrix-goog
matrix_mautrix_googlechat_database_username: 'matrix_mautrix_googlechat'
matrix_mautrix_googlechat_database_password: 'some-password'
matrix_mautrix_googlechat_database_hostname: 'matrix-postgres'
matrix_mautrix_googlechat_database_hostname: ''
matrix_mautrix_googlechat_database_port: 5432
matrix_mautrix_googlechat_database_name: 'matrix_mautrix_googlechat'

View File

@ -1,14 +1,12 @@
---
- name: Fail if required settings not defined
- name: Fail if required mautrix-googlechat 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_mautrix_googlechat_public_endpoint"
- "matrix_mautrix_googlechat_appservice_token"
- "matrix_mautrix_googlechat_homeserver_token"
- ansible.builtin.debug:
msg:
- '`matrix_mautrix_googlechat_homeserver_domain` == {{ matrix_mautrix_googlechat_homeserver_domain }}'
- {'name': 'matrix_mautrix_googlechat_public_endpoint', when: true}
- {'name': 'matrix_mautrix_googlechat_appservice_token', when: true}
- {'name': 'matrix_mautrix_googlechat_homeserver_token', when: true}
- {'name': 'matrix_mautrix_googlechat_database_hostname', when: "{{ matrix_mautrix_googlechat_database_engine == 'postgres' }}"}

View File

@ -65,7 +65,7 @@ matrix_mautrix_hangouts_sqlite_database_path_in_container: "/data/mautrix-hangou
matrix_mautrix_hangouts_database_username: 'matrix_mautrix_hangouts'
matrix_mautrix_hangouts_database_password: 'some-password'
matrix_mautrix_hangouts_database_hostname: 'matrix-postgres'
matrix_mautrix_hangouts_database_hostname: ''
matrix_mautrix_hangouts_database_port: 5432
matrix_mautrix_hangouts_database_name: 'matrix_mautrix_hangouts'

View File

@ -1,14 +1,12 @@
---
- name: Fail if required settings not defined
- name: Fail if required mautrix-hangouts 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_mautrix_hangouts_public_endpoint"
- "matrix_mautrix_hangouts_appservice_token"
- "matrix_mautrix_hangouts_homeserver_token"
- ansible.builtin.debug:
msg:
- '`matrix_mautrix_hangouts_homeserver_domain` == {{ matrix_mautrix_hangouts_homeserver_domain }}'
- {'name': 'matrix_mautrix_hangouts_public_endpoint', when: true}
- {'name': 'matrix_mautrix_hangouts_appservice_token', when: true}
- {'name': 'matrix_mautrix_hangouts_homeserver_token', when: true}
- {'name': 'matrix_mautrix_hangouts_database_hostname', when: "{{ matrix_mautrix_hangouts_database_engine == 'postgres' }}"}

View File

@ -55,7 +55,7 @@ matrix_mautrix_instagram_database_engine: 'postgres'
matrix_mautrix_instagram_database_username: 'matrix_mautrix_instagram'
matrix_mautrix_instagram_database_password: 'some-password'
matrix_mautrix_instagram_database_hostname: 'matrix-postgres'
matrix_mautrix_instagram_database_hostname: ''
matrix_mautrix_instagram_database_port: 5432
matrix_mautrix_instagram_database_name: 'matrix_mautrix_instagram'

View File

@ -1,9 +1,10 @@
---
- name: Fail if required settings not defined
- name: Fail if required mautrix-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_mautrix_instagram_appservice_token"
- "matrix_mautrix_instagram_homeserver_token"
- {'name': 'matrix_mautrix_instagram_appservice_token', when: true}
- {'name': 'matrix_mautrix_instagram_homeserver_token', when: true}
- {'name': 'matrix_mautrix_instagram_database_hostname', when: "{{ matrix_mautrix_instagram_database_engine == 'postgres' }}"}

View File

@ -76,7 +76,7 @@ matrix_mautrix_signal_database_engine: 'postgres'
matrix_mautrix_signal_database_username: 'matrix_mautrix_signal'
matrix_mautrix_signal_database_password: 'some-password'
matrix_mautrix_signal_database_hostname: 'matrix-postgres'
matrix_mautrix_signal_database_hostname: ''
matrix_mautrix_signal_database_port: 5432
matrix_mautrix_signal_database_name: 'matrix_mautrix_signal'

View File

@ -1,15 +1,16 @@
---
- name: Fail if required settings not defined
- name: Fail if required mautrix-signal 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_mautrix_signal_homeserver_domain"
- "matrix_mautrix_signal_homeserver_address"
- "matrix_mautrix_signal_homeserver_token"
- "matrix_mautrix_signal_appservice_token"
- {'name': 'matrix_mautrix_signal_homeserver_domain', when: true}
- {'name': 'matrix_mautrix_signal_homeserver_address', when: true}
- {'name': 'matrix_mautrix_signal_homeserver_token', when: true}
- {'name': 'matrix_mautrix_signal_appservice_token', when: true}
- {'name': 'matrix_mautrix_signal_database_hostname', when: "{{ matrix_mautrix_signal_database_engine == 'postgres' }}"}
- name: (Deprecation) Fail if matrix_mautrix_signal_bridge_permissions specified as YAML string, instead of a dictionary
ansible.builtin.fail:

View File

@ -95,7 +95,7 @@ matrix_mautrix_telegram_sqlite_database_path_in_container: "/data/mautrix-telegr
matrix_mautrix_telegram_database_username: 'matrix_mautrix_telegram'
matrix_mautrix_telegram_database_password: 'some-password'
matrix_mautrix_telegram_database_hostname: 'matrix-postgres'
matrix_mautrix_telegram_database_hostname: ''
matrix_mautrix_telegram_database_port: 5432
matrix_mautrix_telegram_database_name: 'matrix_mautrix_telegram'

View File

@ -1,16 +1,17 @@
---
- name: Fail if required settings not defined
- name: Fail if required mautrix-telegram 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_mautrix_telegram_api_id"
- "matrix_mautrix_telegram_api_hash"
- "matrix_mautrix_telegram_public_endpoint"
- "matrix_mautrix_telegram_appservice_token"
- "matrix_mautrix_telegram_homeserver_token"
- {'name': 'matrix_mautrix_telegram_api_id', when: true}
- {'name': 'matrix_mautrix_telegram_api_hash', when: true}
- {'name': 'matrix_mautrix_telegram_public_endpoint', when: true}
- {'name': 'matrix_mautrix_telegram_appservice_token', when: true}
- {'name': 'matrix_mautrix_telegram_homeserver_token', when: true}
- {'name': 'matrix_mautrix_telegram_database_hostname', when: "{{ matrix_mautrix_telegram_database_engine == 'postgres' }}"}
- name: (Deprecation) Catch and report renamed Telegram variables
ansible.builtin.fail:

View File

@ -54,7 +54,7 @@ matrix_mautrix_twitter_federate_rooms: true
matrix_mautrix_twitter_database_engine: 'postgres'
matrix_mautrix_twitter_database_username: 'matrix_mautrix_twitter'
matrix_mautrix_twitter_database_password: ''
matrix_mautrix_twitter_database_password: 'some-password'
matrix_mautrix_twitter_database_hostname: ''
matrix_mautrix_twitter_database_port: 5432
matrix_mautrix_twitter_database_name: 'matrix_mautrix_twitter'

View File

@ -3,10 +3,9 @@
- name: Fail if required mautrix-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_mautrix_twitter_appservice_token"
- "matrix_mautrix_twitter_homeserver_token"
- "matrix_mautrix_twitter_database_hostname"
- "matrix_mautrix_twitter_database_password"
- {'name': 'matrix_mautrix_twitter_appservice_token', when: true}
- {'name': 'matrix_mautrix_twitter_homeserver_token', when: true}
- {'name': 'matrix_mautrix_twitter_database_hostname', when: "{{ matrix_mautrix_twitter_database_engine == 'postgres' }}"}

View File

@ -61,7 +61,7 @@ matrix_mautrix_whatsapp_sqlite_database_path_in_container: "/data/mautrix-whatsa
matrix_mautrix_whatsapp_database_username: 'matrix_mautrix_whatsapp'
matrix_mautrix_whatsapp_database_password: 'some-password'
matrix_mautrix_whatsapp_database_hostname: 'matrix-postgres'
matrix_mautrix_whatsapp_database_hostname: ''
matrix_mautrix_whatsapp_database_port: 5432
matrix_mautrix_whatsapp_database_name: 'matrix_mautrix_whatsapp'

View File

@ -1,14 +1,14 @@
---
- name: Fail if required settings not defined
- name: Fail if required mautrix-whatsapp 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_mautrix_whatsapp_appservice_token"
- "matrix_mautrix_whatsapp_homeserver_token"
- {'name': 'matrix_mautrix_whatsapp_appservice_token', when: true}
- {'name': 'matrix_mautrix_whatsapp_homeserver_token', when: true}
- {'name': 'matrix_mautrix_whatsapp_database_hostname', when: "{{ matrix_mautrix_whatsapp_database_engine == 'postgres' }}"}
- name: (Deprecation) Catch and report renamed settings
ansible.builtin.fail:

View File

@ -65,7 +65,7 @@ matrix_dimension_sqlite_database_path_in_container: "dimension.db"
matrix_dimension_database_username: 'matrix_dimension'
matrix_dimension_database_password: 'some-password'
matrix_dimension_database_hostname: 'matrix-postgres'
matrix_dimension_database_hostname: ''
matrix_dimension_database_port: 5432
matrix_dimension_database_name: 'matrix_dimension'

View File

@ -1,11 +1,13 @@
---
- name: Fail if required Dimension settings not defined
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`) for using Dimension.
msg: >
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and vars[item.name] == ''"
with_items:
- "matrix_dimension_access_token"
when: "matrix_dimension_enabled and vars[item] == ''"
- {'name': 'matrix_dimension_access_token', when: true}
- {'name': 'matrix_dimension_database_hostname', when: "{{ matrix_dimension_database_engine == 'postgres' }}"}
- name: (Deprecation) Catch and report renamed Dimension variables
ansible.builtin.fail:

View File

@ -45,7 +45,7 @@ matrix_etherpad_database_engine: 'postgres'
matrix_etherpad_database_username: 'matrix_etherpad'
matrix_etherpad_database_password: 'some-password'
matrix_etherpad_database_hostname: 'matrix-postgres'
matrix_etherpad_database_hostname: ''
matrix_etherpad_database_port: 5432
matrix_etherpad_database_name: 'matrix_etherpad'

View File

@ -1,10 +1,12 @@
---
- name: Fail if no database is configured for Etherpad
- name: Fail if required Etherpad settings not defined
ansible.builtin.fail:
msg: >-
Etherpad requires a dedicated Postgres database. Please enable the built in one, or configure an external DB by redefining "matrix_etherpad_database_hostname"
when: matrix_etherpad_database_hostname == ''
msg: >
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and vars[item.name] == ''"
with_items:
- {'name': 'matrix_etherpad_database_hostname', when: true}
- name: Fail if wrong mode selected
ansible.builtin.fail:

View File

@ -64,7 +64,7 @@ matrix_ma1sd_sqlite_database_path_in_container: "/var/ma1sd/ma1sd.db"
matrix_ma1sd_database_username: 'matrix_ma1sd'
matrix_ma1sd_database_password: 'some-password'
matrix_ma1sd_database_hostname: 'matrix-postgres'
matrix_ma1sd_database_hostname: ''
matrix_ma1sd_database_port: 5432
matrix_ma1sd_database_name: 'matrix_ma1sd'

View File

@ -42,11 +42,12 @@
- name: Fail if required ma1sd settings not defined
ansible.builtin.fail:
msg: >
You need to define a required configuration setting (`{{ item }}`) for using ma1sd.
when: "vars[item] == ''"
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and vars[item.name] == ''"
with_items:
- "matrix_ma1sd_threepid_medium_email_connectors_smtp_host"
- "matrix_ma1sd_dns_overwrite_homeserver_client_value"
- {'name': 'matrix_ma1sd_threepid_medium_email_connectors_smtp_host', when: true}
- {'name': 'matrix_ma1sd_dns_overwrite_homeserver_client_value', when: true}
- {'name': 'matrix_ma1sd_database_hostname', when: "{{ matrix_ma1sd_database_engine == 'postgres' }}"}
- name: (Deprecation) Catch and report renamed ma1sd variables
ansible.builtin.fail:

View File

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

View File

@ -24,7 +24,7 @@ matrix_prometheus_postgres_exporter_systemd_wanted_services_list: []
# details for connecting to the database
matrix_prometheus_postgres_exporter_database_username: 'matrix_prometheus_postgres_exporter'
matrix_prometheus_postgres_exporter_database_password: 'some-password'
matrix_prometheus_postgres_exporter_database_hostname: 'matrix-postgres'
matrix_prometheus_postgres_exporter_database_hostname: ''
matrix_prometheus_postgres_exporter_database_port: 5432
matrix_prometheus_postgres_exporter_database_name: 'matrix_prometheus_postgres_exporter'

View File

@ -10,6 +10,9 @@
- install-nginx-proxy
- block:
- when: matrix_prometheus_postgres_exporter_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
- when: matrix_prometheus_postgres_exporter_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
tags:

View File

@ -0,0 +1,9 @@
---
- name: Fail if required prometheus-postgres-exporter settings not defined
ansible.builtin.fail:
msg: >
You need to define a required configuration setting (`{{ item }}`).
when: "vars[item] == ''"
with_items:
- matrix_prometheus_postgres_exporter_database_hostname

View File

@ -52,7 +52,7 @@ matrix_registration_sqlite_database_path_in_container: "/data/db.sqlite3"
matrix_registration_database_username: 'matrix_registration'
matrix_registration_database_password: 'some-password'
matrix_registration_database_hostname: 'matrix-postgres'
matrix_registration_database_hostname: ''
matrix_registration_database_port: 5432
matrix_registration_database_name: 'matrix_registration'

View File

@ -3,12 +3,13 @@
- name: Fail if required matrix-registration settings not defined
ansible.builtin.fail:
msg: >
You need to define a required configuration setting (`{{ item }}`) for using matrix-registration.
when: "vars[item] == ''"
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and vars[item.name] == ''"
with_items:
- "matrix_registration_shared_secret"
- "matrix_registration_admin_secret"
- "matrix_registration_server_location"
- {'name': 'matrix_registration_shared_secret', when: true}
- {'name': 'matrix_registration_admin_secret', when: true}
- {'name': 'matrix_registration_server_location', when: true}
- {'name': 'matrix_registration_database_hostname', when: "{{ matrix_registration_database_engine == 'postgres' }}"}
- name: (Deprecation) Catch and report renamed settings
ansible.builtin.fail: