GHP publish
This commit is contained in:
19
roles/roundcube/tasks/main.yaml
Normal file
19
roles/roundcube/tasks/main.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
- name: Import secret.yaml to obtain secrets
|
||||
include_tasks: secrets.yaml
|
||||
when:
|
||||
- roundcube_use_external_db
|
||||
- postgres_enable
|
||||
|
||||
- set_fact:
|
||||
roundcube_combined_values: "{{ roundcube_default_values | combine(roundcube_values, recursive=true) }}"
|
||||
|
||||
- name: Deploy RoundCube
|
||||
community.kubernetes.helm:
|
||||
create_namespace: true
|
||||
release_namespace: "{{ roundcube_namespace | default(mail_namespace) | default(namespace) }}"
|
||||
release_name: "{{ roundcube_name | default('roundcube') }}"
|
||||
chart_ref: "{{ roundcube_chart | default('ghp/roundcube') }}"
|
||||
chart_version: "{{ roundcube_version | default(omit) }}"
|
||||
release_values: "{{ roundcube_combined_values | from_yaml }}"
|
||||
wait: true
|
||||
|
25
roles/roundcube/tasks/secrets.yaml
Normal file
25
roles/roundcube/tasks/secrets.yaml
Normal file
@ -0,0 +1,25 @@
|
||||
- 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 }}"
|
||||
|
Reference in New Issue
Block a user