2022-09-11 16:49:31 +00:00
|
|
|
---
|
|
|
|
- name: Create postgres namespace
|
|
|
|
kubernetes.core.k8s:
|
|
|
|
name: postgres
|
|
|
|
api_version: v1
|
|
|
|
kind: Namespace
|
|
|
|
state: present
|
2022-12-28 17:38:21 +00:00
|
|
|
definition:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
prometheus: default
|
2022-09-11 16:49:31 +00:00
|
|
|
|
|
|
|
- name: Create Postgres secret
|
|
|
|
kubernetes.core.k8s:
|
|
|
|
state: present
|
|
|
|
definition:
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Secret
|
|
|
|
metadata:
|
|
|
|
name: postgres-credentials
|
|
|
|
namespace: postgres
|
|
|
|
data:
|
|
|
|
postgres-password: "{{ PostgresPassword | b64encode }}"
|
|
|
|
|
|
|
|
- name: Add Bitnami chart repo
|
|
|
|
kubernetes.core.helm_repository:
|
|
|
|
name: bitnami
|
|
|
|
repo_url: https://charts.bitnami.com/bitnami
|
|
|
|
|
2022-12-28 17:38:21 +00:00
|
|
|
- name: Deploy Postgres 15
|
|
|
|
kubernetes.core.helm:
|
|
|
|
name: postgres-15
|
|
|
|
chart_ref: bitnami/postgresql
|
|
|
|
release_namespace: postgres
|
2023-07-19 18:55:17 +00:00
|
|
|
chart_version: "12.6.4"
|
2022-12-28 17:38:21 +00:00
|
|
|
release_values: "{{ lookup('ansible.builtin.file', 'values.postgres15.yaml') | from_yaml }}"
|