From 39cc83ac571beca6a01c3ddc3bce6e6cf8d87cc0 Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Thu, 14 Jul 2022 10:33:26 +0200 Subject: [PATCH] Add missing key;Add traefik ssh entrypoint --- .../ansible_payload/roles/metacluster/tasks/main.yml | 8 ++++---- ansible/roles/metacluster/tasks/k3s.yml | 9 +++++++++ .../roles/metacluster/templates/helmchartconfig.j2 | 8 ++++++++ ansible/vars/metacluster.yml | 11 +++++++++++ 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 ansible/roles/metacluster/templates/helmchartconfig.j2 diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/main.yml b/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/main.yml index 25bbe89..7bd8a85 100644 --- a/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/main.yml +++ b/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/main.yml @@ -190,14 +190,14 @@ loop: - organization: mc body: - name: ArgoCD.Config, - # auto_init: true + name: ArgoCD.Config + auto_init: true default_branch: main description: GitOps manifests - organization: wl body: - name: Template.ArgoCD.Config, - # auto_init: true + name: Template.ArgoCD.Config + auto_init: true default_branch: main description: GitOps manifests loop_control: diff --git a/ansible/roles/metacluster/tasks/k3s.yml b/ansible/roles/metacluster/tasks/k3s.yml index d94e009..59ba630 100644 --- a/ansible/roles/metacluster/tasks/k3s.yml +++ b/ansible/roles/metacluster/tasks/k3s.yml @@ -4,8 +4,17 @@ state: directory loop: - /var/lib/rancher/k3s/agent/images + - /var/lib/rancher/k3s/server/manifests - /opt/metacluster/k3s +- name: Inject manifests + ansible.builtin.template: + src: helmchartconfig.j2 + dest: /var/lib/rancher/k3s/server/manifests/{{ item.name }}_config.yml + loop: "{{ platform.packaged_components }}" + loop_control: + label: "{{ item.name }}" + - name: Download & install K3s binary ansible.builtin.get_url: url: https://github.com/k3s-io/k3s/releases/download/{{ platform.k3s.version }}/k3s diff --git a/ansible/roles/metacluster/templates/helmchartconfig.j2 b/ansible/roles/metacluster/templates/helmchartconfig.j2 new file mode 100644 index 0000000..0b79eec --- /dev/null +++ b/ansible/roles/metacluster/templates/helmchartconfig.j2 @@ -0,0 +1,8 @@ +apiVersion: helm.cattle.io/v1 +kind: HelmChartConfig +metadata: + name: {{ item.name }} + namespace: {{ item.namespace }} +spec: + valuesContent: |- +{{ item.config }} diff --git a/ansible/vars/metacluster.yml b/ansible/vars/metacluster.yml index 2b13468..d4219b3 100644 --- a/ansible/vars/metacluster.yml +++ b/ansible/vars/metacluster.yml @@ -3,6 +3,17 @@ platform: k3s: version: v1.24.1+k3s1 + packaged_components: + - name: traefik + namespace: kube-system + config: |4 + ports: + ssh: + port: 8022 + protocol: TCP + web: + redirectTo: websecure + helm_repositories: - name: longhorn url: https://charts.longhorn.io