ansible/roles/nextcloud/tasks/secrets.yaml

26 lines
930 B
YAML
Raw Normal View History

2021-01-09 17:54:42 +00:00
- block:
- name: Set DB namespace for secret lookup
set_fact:
db_namespace: "{{ nextcloud_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: "nextcloud.{{ postgres_db_team | default(namespace) }}-postgres.credentials.postgresql.acid.zalan.do"
- name: Lookup Nextcloud DB secret
set_fact:
nextcloud_db_secret: "{{ lookup('k8s', kind='Secret', namespace=db_namespace, resource_name=db_secret_name) }}"
- debug:
msg: "{{ nextcloud_db_secret }}"
verbosity: 2
- name: Set Nextcloud DB username
set_fact:
nextcloud_db_username: "{{ nextcloud_db_secret.data.username | b64decode }}"
- name: Set Nextcloud DB password
set_fact:
nextcloud_db_password: "{{ nextcloud_db_secret.data.password | b64decode }}"