diff --git a/roles/restore/tasks/secrets.yml b/roles/restore/tasks/secrets.yml index f049d1cb..7bd0d5bf 100644 --- a/roles/restore/tasks/secrets.yml +++ b/roles/restore/tasks/secrets.yml @@ -32,11 +32,16 @@ set_fact: _generated_pg_secret_name: "{{ deployment_name }}-postgres-configuration" - - name: Override postgres_configuration_secret + - name: Set tmp database dict + set_fact: + _tmp_database: "{{ spec['database'] | combine({'database_secret': _generated_pg_secret_name}, recursive=True) }}" + no_log: "{{ no_log }}" + + - name: Override database_secret set_fact: spec: - "{{ spec | combine({'postgres_configuration_secret': _generated_pg_secret_name}, recursive=True) }}" - when: secrets['postgresConfigurationSecret']['data']['type'] | b64decode == 'managed' + "{{ spec | combine({'database': _tmp_database}, recursive=True) }}" + when: secrets['databaseConfigurationSecret']['data']['type'] | b64decode == 'managed' - name: If deployment is managed, set the database_host in the pg config secret block: