Files
provisioning/ansible-5/roles/prod.k3s/tasks/deployments/nextcloud.yaml
2023-03-24 20:07:52 -04:00

55 lines
1.5 KiB
YAML

---
# https://github.com/nextcloud/helm/tree/master/charts/nextcloud
- name: Create a namespace for nextcloud
k8s:
kubeconfig: "/etc/rancher/k3s/k3s.yaml"
name: "{{apps.nextcloud.namespace}}"
api_version: v1
kind: Namespace
state: "{{present}}"
become: true
- name: create persistent volume resources
kubernetes.core.k8s:
kubeconfig: "/etc/rancher/k3s/k3s.yaml"
state: "present"
definition: "{{ lookup('template', item) | from_yaml }}"
loop:
# - nextcloud/pv-apps.yaml
# - nextcloud/pv-data.yaml
# - nextcloud/pv-configs.yaml
- nextcloud/pv-main.yaml
# - nextcloud/pv-apps-claim.yaml
# - nextcloud/pv-data-claim.yaml
# - nextcloud/pv-configs-claim.yaml
- nextcloud/pv-main-claim.yaml
become: true
- name: Install nextcloud globally available
block:
- name: Add nextcloud chart helm repo
local_action:
module: kubernetes.core.helm_repository
name: nextcloud
repo_url: https://nextcloud.github.io/helm/
- name: load variables files/nextcloud/values.yaml
ansible.builtin.include_vars:
file: files/nextcloud/values.yaml
name: stash_values
- name: Install Nextcloud Release
local_action:
module: kubernetes.core.helm
release_state: "present"
name: nextcloud
namespace: "{{apps.nextcloud.namespace}}"
create_namespace: yes
update_repo_cache: True
chart_ref: nextcloud/nextcloud
values: "{{stash_values}}"
wait: true