mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-26 21:33:14 +00:00
Allow users to change pg name, pw & db name for a managed postgres
- set default value for postgres-configuration type as unmanaged if secret is created
This commit is contained in:
@@ -229,9 +229,12 @@ stringData:
|
||||
username: <username to connect as>
|
||||
password: <password to connect with>
|
||||
sslmode: prefer
|
||||
type: unmanaged
|
||||
type: Opaque
|
||||
```
|
||||
|
||||
> It is possible to set a specific username, password, or database, but still have the database managed by the operator. In this case, when creating the postgres-configuration secret, the `type: managed` field should be added.
|
||||
|
||||
**Note**: The variable `sslmode` is valid for `external` databases only. The allowed values are: `prefer`, `disable`, `allow`, `require`, `verify-ca`, `verify-full`.
|
||||
|
||||
#### Migrating data from an old AWX instance
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
database_name: "{{ _postgres_configuration['resources'][0]['data']['database'] | b64decode }}"
|
||||
database_port: "{{ _postgres_configuration['resources'][0]['data']['port'] | b64decode }}"
|
||||
database_host: "{{ _postgres_configuration['resources'][0]['data']['host'] | b64decode }}"
|
||||
database_type: "{{ _postgres_configuration['resources'][0]['data']['type'] | b64decode }}"
|
||||
database_type: "{{ _postgres_configuration['resources'][0]['data']['type'] | b64decode | default('unmanaged')}}"
|
||||
|
||||
- name: Template secrets into yaml
|
||||
set_fact:
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
field_selectors:
|
||||
- status.phase=Running
|
||||
register: postgres_pod
|
||||
until: postgres_pod['resources'] | length
|
||||
until:
|
||||
- "postgres_pod['resources'] | length"
|
||||
- "postgres_pod['resources'][0]['status']['phase'] == 'Running'"
|
||||
delay: 5
|
||||
retries: 60
|
||||
|
||||
|
||||
@@ -53,17 +53,17 @@ spec:
|
||||
- name: POSTGRES_DB
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ meta.name }}-postgres-configuration'
|
||||
name: '{{ tower_postgres_configuration_secret }}'
|
||||
key: database
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ meta.name }}-postgres-configuration'
|
||||
name: '{{ tower_postgres_configuration_secret }}'
|
||||
key: username
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ meta.name }}-postgres-configuration'
|
||||
name: '{{ tower_postgres_configuration_secret }}'
|
||||
key: password
|
||||
- name: PGDATA
|
||||
value: '{{ tower_postgres_data_path }}'
|
||||
|
||||
Reference in New Issue
Block a user