mariadb clean setup
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user