Ensure additional databases contain all the keys that we expect

This commit is contained in:
Slavi Pantaleev 2020-12-14 00:39:38 +02:00
parent da4cb2f639
commit 3a037a5993

View 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.