Sfoglia il codice sorgente

Ensure additional databases contain all the keys that we expect

pull/740/head
Slavi Pantaleev 5 anni fa
parent
commit
3a037a5993
1 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  1. +7
    -1
      roles/matrix-postgres/tasks/util/create_additional_database.yml

+ 7
- 1
roles/matrix-postgres/tasks/util/create_additional_database.yml Vedi File

@@ -1,6 +1,12 @@
---

# TODO - ensure `additional_db` contains all keys that we expect
# It'd be better if this is belonged to `validate_config.yml`, but it would have to be some loop-within-a-loop there,
# and that's ugly. We also don't expect this to catch errors often. It's more of a defensive last-minute check.
- name: Fail if additional database data appears invalid
fail:
msg: "Additional database definition ({{ additional_db }} lacks a required key: {{ item }}"
when: "item not in additional_db"
with_items: "{{ ['name', 'username', 'pass'] }}"

# The SQL statements that we'll run against Postgres are stored in a file that others can't read.
# This file will be mounted into the container and fed to Postgres.


Caricamento…
Annulla
Salva