# Postgres Secret.
---
apiVersion: v1
kind: Secret
metadata:
  name: '{{ ansible_operator_meta.name }}-postgres-configuration'
  namespace: '{{ ansible_operator_meta.namespace }}'
  labels:
    app.kubernetes.io/name: '{{ ansible_operator_meta.name }}'
    app.kubernetes.io/part-of: '{{ ansible_operator_meta.name }}'
    app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
    app.kubernetes.io/component: '{{ deployment_type }}'
    app.kubernetes.io/operator-version: '{{ lookup("env", "OPERATOR_VERSION") }}'
stringData:
  password: '{{ lookup('password', '/dev/null length=32 chars=ascii_letters,digits') }}'
  username: '{{ database_username }}'
  database: '{{ database_name }}'
  port: '5432'
  host: {{ ansible_operator_meta.name }}-postgres
  type: 'managed'
