mariadb clean setup

This commit is contained in:
2022-10-22 13:12:26 -04:00
parent 991820939a
commit 3d038800ef
8 changed files with 117 additions and 41 deletions

View File

@@ -2,29 +2,43 @@
#https://github.com/bitnami/charts/tree/master/bitnami/mariadb
- name: "todo: deploy mariadb"
debug:
msg: "TODO: write deployment tasks"
- name: Create a namespace for mariadb
k8s:
kubeconfig: "/etc/rancher/k3s/k3s.yaml"
name: mariadb
name: "{{apps.mariadb.namespace}}"
api_version: v1
kind: Namespace
state: present
state: "{{apps.mariadb.state}}"
become: true
- name: create persistent volume resources
kubernetes.core.k8s:
kubeconfig: "/etc/rancher/k3s/k3s.yaml"
state: present
state: "{{apps.mariadb.state}}"
definition: "{{ lookup('template', item) | from_yaml }}"
loop:
- mariadb/pv.yaml
- mariadb/pv-claim.yaml
become: true
- name: create secret for mariadb
kubernetes.core.k8s:
kubeconfig: "/etc/rancher/k3s/k3s.yaml"
state: "{{apps.mariadb.state}}"
definition:
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: mariadb-secrets
namespace: "{{apps.mariadb.namespace}}"
stringData:
mariadb-password: "{{apps.mariadb.secrets.password}}"
mariadb-root-password: "{{apps.mariadb.secrets.root_password}}"
mariadb-replication-password: "{{apps.mariadb.secrets.replication_password}}"
become: true
- name: Install mariadb globally available
block:
- name: Add mariadb chart helm repo
@@ -41,9 +55,9 @@
- name: Install mariadb Release
local_action:
module: kubernetes.core.helm
release_state: present
name: "{{apps.mariadb.namespace}}"
namespace: mariadb
release_state: "{{apps.mariadb.state}}"
name: mariadb
namespace: "{{apps.mariadb.namespace}}"
create_namespace: yes
update_repo_cache: True
chart_ref: bitnami/mariadb

View File

@@ -16,8 +16,9 @@
- name: deploy stash
include_tasks: deployments/stash.yaml
#- name: deploy mariadb
# include_tasks: deployments/mariadb.yaml
- name: deploy mariadb
include_tasks: deployments/mariadb.yaml
when: apps.mariadb.enabled
- name: deploy gitea
include_tasks: deployments/gitea.yaml