Files
vps/ansible/roles/matrix_cluster_base/tasks/main.yml
T

25 lines
745 B
YAML

---
- name: Require a working K3s kubeconfig
ansible.builtin.stat:
path: /etc/rancher/k3s/k3s.yaml
register: matrix_cluster_kubeconfig
- name: Assert K3s is ready before creating cluster resources
ansible.builtin.assert:
that:
- matrix_cluster_kubeconfig.stat.exists
fail_msg: Run k3s-server.yml successfully before matrix-cluster-base.yml.
- name: Install Matrix cluster base manifest
ansible.builtin.template:
src: base-resources.yaml.j2
dest: /etc/rancher/k3s/matrix-cluster-base.yaml
owner: root
group: root
mode: "0600"
- name: Apply Matrix cluster base manifest
ansible.builtin.command:
argv: [k3s, kubectl, apply, -f, /etc/rancher/k3s/matrix-cluster-base.yaml]
changed_when: false