mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 06:29:31 -02:30
Put postgresql values in a tempfile, to be loaded by helm cli
Helm 3.x does not support passing values via stdin: https://github.com/helm/helm/issues/7002 So setup a tempfile and write the template to the tempfile to be loaded by helm ... --values <tempfile> Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
This commit is contained in:
committed by
Bryan Hundven
parent
34d01f02cc
commit
1c50b8427a
@@ -79,19 +79,26 @@
|
|||||||
|
|
||||||
- name: Deploy PostgreSQL (Kubernetes)
|
- name: Deploy PostgreSQL (Kubernetes)
|
||||||
block:
|
block:
|
||||||
- name: Template PostgreSQL Deployment (Kubernetes)
|
- name: Create Temporary Values File (Kubernetes)
|
||||||
set_fact:
|
tempfile:
|
||||||
pg_values: "{{ lookup('template', 'postgresql-values.yml.j2') }}"
|
state: file
|
||||||
|
suffix: .yml
|
||||||
|
register: values_file
|
||||||
|
|
||||||
|
- name: Populate Temporary Values File (Kubernetes)
|
||||||
|
template:
|
||||||
|
src: postgresql-values.yml.j2
|
||||||
|
dest: "{{ values_file.path }}"
|
||||||
no_log: true
|
no_log: true
|
||||||
|
|
||||||
- name: Deploy and Activate Postgres (Kubernetes)
|
- name: Deploy and Activate Postgres (Kubernetes)
|
||||||
shell: |
|
shell: |
|
||||||
helm repo update
|
helm repo update
|
||||||
echo {{ pg_values | quote }} | helm upgrade {{ postgresql_service_name }} \
|
helm upgrade {{ postgresql_service_name }} \
|
||||||
--install \
|
--install \
|
||||||
--namespace {{ kubernetes_namespace }} \
|
--namespace {{ kubernetes_namespace }} \
|
||||||
--version="8.1.5" \
|
--version="8.1.5" \
|
||||||
--values - \
|
--values {{ values_file.path }} \
|
||||||
stable/postgresql
|
stable/postgresql
|
||||||
register: kubernetes_pg_activate
|
register: kubernetes_pg_activate
|
||||||
no_log: true
|
no_log: true
|
||||||
|
|||||||
Reference in New Issue
Block a user