From 25941433f5c1872db2f78bf9dc59f171664ac787 Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Fri, 10 Nov 2023 11:32:00 -0800 Subject: [PATCH 1/3] Allow additional manifests to be deployed Signed-off-by: Derek Nola --- inventory-sample.yml | 3 +++ roles/prereq/tasks/main.yml | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/inventory-sample.yml b/inventory-sample.yml index 662e1e26..a94e4389 100644 --- a/inventory-sample.yml +++ b/inventory-sample.yml @@ -24,3 +24,6 @@ k3s_cluster: # k3s_server_location: /var/lib/rancher/k3s # systemd_dir: /etc/systemd/system # extra_service_envs: [ 'ENV_VAR1=VALUE1', 'ENV_VAR2=VALUE2' ] + # List of locally available manifests to apply to the cluster, useful for PVCs or Traefik modifications. + # Manifests should be either full paths or relative to the playbook directory. + # extra_manifests: [ '/path/to/manifest1.yaml', '/path/to/manifest2.yaml' ] \ No newline at end of file diff --git a/roles/prereq/tasks/main.yml b/roles/prereq/tasks/main.yml index a8b261c3..573ea19f 100644 --- a/roles/prereq/tasks/main.yml +++ b/roles/prereq/tasks/main.yml @@ -172,3 +172,18 @@ src: "{{ k3s_server_location }}" force: true state: link + +- name: Setup extra manifests + when: extra_manifests is defined + block: + - name: Make manifests directory + ansible.builtin.file: + path: "/var/lib/rancher/k3s/server/manifests" + mode: 0700 + state: directory + - name: Copy manifests + ansible.builtin.copy: + src: "{{ item }}" + dest: "/var/lib/rancher/k3s/server/manifests" + mode: 0600 + loop: "{{ extra_manifests }}" \ No newline at end of file From edcdf67aaa4b694ac55ed689de60a3c190f29aa4 Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Fri, 10 Nov 2023 11:37:33 -0800 Subject: [PATCH 2/3] Lint Signed-off-by: Derek Nola --- inventory-sample.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventory-sample.yml b/inventory-sample.yml index a94e4389..7940ebf2 100644 --- a/inventory-sample.yml +++ b/inventory-sample.yml @@ -26,4 +26,4 @@ k3s_cluster: # extra_service_envs: [ 'ENV_VAR1=VALUE1', 'ENV_VAR2=VALUE2' ] # List of locally available manifests to apply to the cluster, useful for PVCs or Traefik modifications. # Manifests should be either full paths or relative to the playbook directory. - # extra_manifests: [ '/path/to/manifest1.yaml', '/path/to/manifest2.yaml' ] \ No newline at end of file + # extra_manifests: [ '/path/to/manifest1.yaml', '/path/to/manifest2.yaml' ] From bf9ab1ef3ef2a746f70e5b0fc8ef526273c8a5bc Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Fri, 10 Nov 2023 12:10:50 -0800 Subject: [PATCH 3/3] lint pt 2 Signed-off-by: Derek Nola --- roles/prereq/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/prereq/tasks/main.yml b/roles/prereq/tasks/main.yml index 573ea19f..7135495b 100644 --- a/roles/prereq/tasks/main.yml +++ b/roles/prereq/tasks/main.yml @@ -186,4 +186,4 @@ src: "{{ item }}" dest: "/var/lib/rancher/k3s/server/manifests" mode: 0600 - loop: "{{ extra_manifests }}" \ No newline at end of file + loop: "{{ extra_manifests }}"