Skip to content

Commit

Permalink
Fail early if postgres_configuration_secret is specified by does not …
Browse files Browse the repository at this point in the history
…exist
  • Loading branch information
rooftopcellist committed Feb 10, 2025
1 parent 3d1ecc1 commit 625ecd2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions roles/installer/tasks/database_configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@
set_fact:
_default_postgres_image: "{{ _postgres_image }}:{{_postgres_image_version }}"

- name: Fail if PostgreSQL secret is specified, but not found
fail:
msg: "PostgreSQL configuration {{ postgres_configuration_secret }} not found in namespace {{ ansible_operator_meta.namespace }}"
when:
- _custom_pg_config_resources is defined
- _custom_pg_config_resources['resources'] | length == 0

- name: Set PostgreSQL configuration
set_fact:
_pg_config: '{{ _custom_pg_config_resources["resources"] | default([]) | length | ternary(_custom_pg_config_resources, _default_pg_config_resources) }}'
Expand Down

0 comments on commit 625ecd2

Please sign in to comment.