Compare commits
2 Commits
e7e3b69d95
...
39cc83ac57
| Author | SHA1 | Date | |
|---|---|---|---|
| 39cc83ac57 | |||
| 0263b2dfc4 |
@@ -190,14 +190,14 @@
|
|||||||
loop:
|
loop:
|
||||||
- organization: mc
|
- organization: mc
|
||||||
body:
|
body:
|
||||||
name: ArgoCD.Config,
|
name: ArgoCD.Config
|
||||||
# auto_init: true
|
auto_init: true
|
||||||
default_branch: main
|
default_branch: main
|
||||||
description: GitOps manifests
|
description: GitOps manifests
|
||||||
- organization: wl
|
- organization: wl
|
||||||
body:
|
body:
|
||||||
name: Template.ArgoCD.Config,
|
name: Template.ArgoCD.Config
|
||||||
# auto_init: true
|
auto_init: true
|
||||||
default_branch: main
|
default_branch: main
|
||||||
description: GitOps manifests
|
description: GitOps manifests
|
||||||
loop_control:
|
loop_control:
|
||||||
|
|||||||
11
ansible/roles/metacluster/tasks/config.yml
Normal file
11
ansible/roles/metacluster/tasks/config.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
- name: Create folder structure(s)
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
loop:
|
||||||
|
- /opt/metacluster/git-repositories
|
||||||
|
|
||||||
|
- name: Clone git repository
|
||||||
|
ansible.builtin.git:
|
||||||
|
repo: https://code.spamasaurus.com/djpbessems/GitOps.MetaCluster.git
|
||||||
|
dest: /opt/metacluster/git-repositories
|
||||||
@@ -4,8 +4,17 @@
|
|||||||
state: directory
|
state: directory
|
||||||
loop:
|
loop:
|
||||||
- /var/lib/rancher/k3s/agent/images
|
- /var/lib/rancher/k3s/agent/images
|
||||||
|
- /var/lib/rancher/k3s/server/manifests
|
||||||
- /opt/metacluster/k3s
|
- /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
|
- name: Download & install K3s binary
|
||||||
ansible.builtin.get_url:
|
ansible.builtin.get_url:
|
||||||
url: https://github.com/k3s-io/k3s/releases/download/{{ platform.k3s.version }}/k3s
|
url: https://github.com/k3s-io/k3s/releases/download/{{ platform.k3s.version }}/k3s
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
- name: Pre-stage K3s components
|
- name: Pre-stage K3s components
|
||||||
import_tasks: k3s.yml
|
import_tasks: k3s.yml
|
||||||
|
|
||||||
- name: Pre-stage meta components
|
- name: Pre-stage meta components
|
||||||
import_tasks: components.yml
|
import_tasks: components.yml
|
||||||
|
|
||||||
|
- name: Pre-stage IaC repositories
|
||||||
|
import_tasks: config.yml
|
||||||
|
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
import_tasks: cleanup.yml
|
import_tasks: cleanup.yml
|
||||||
|
|||||||
8
ansible/roles/metacluster/templates/helmchartconfig.j2
Normal file
8
ansible/roles/metacluster/templates/helmchartconfig.j2
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
apiVersion: helm.cattle.io/v1
|
||||||
|
kind: HelmChartConfig
|
||||||
|
metadata:
|
||||||
|
name: {{ item.name }}
|
||||||
|
namespace: {{ item.namespace }}
|
||||||
|
spec:
|
||||||
|
valuesContent: |-
|
||||||
|
{{ item.config }}
|
||||||
@@ -3,6 +3,17 @@ platform:
|
|||||||
k3s:
|
k3s:
|
||||||
version: v1.24.1+k3s1
|
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:
|
helm_repositories:
|
||||||
- name: longhorn
|
- name: longhorn
|
||||||
url: https://charts.longhorn.io
|
url: https://charts.longhorn.io
|
||||||
|
|||||||
Reference in New Issue
Block a user