ansible/roles/roundcube/tasks/secrets.yaml
2021-01-09 20:54:42 +03:00

26 lines
930 B
YAML

- block:
- name: Set DB namespace for secret lookup
set_fact:
db_namespace: "{{ roundcube_db_namespace | default(postgres_db_namespace) | default(postgres_namespace) | default(postgres_operator_namespace) | default(namespace) }}"
- name: Set DB secret name for lookup
set_fact:
db_secret_name: "roundcube.{{ postgres_db_team | default(namespace) }}-postgres.credentials.postgresql.acid.zalan.do"
- name: Lookup Roundcube DB secret
set_fact:
roundcube_db_secret: "{{ lookup('k8s', kind='Secret', namespace=db_namespace, resource_name=db_secret_name) }}"
- debug:
msg: "{{ roundcube_db_secret }}"
verbosity: 2
- name: Set Roundcube DB username
set_fact:
roundcube_db_username: "{{ roundcube_db_secret.data.username | b64decode }}"
- name: Set Roundcube DB password
set_fact:
roundcube_db_password: "{{ roundcube_db_secret.data.password | b64decode }}"