From 2307546be20f28a811fc9125ac6e88645f1a6b71 Mon Sep 17 00:00:00 2001 From: nolte Date: Sat, 11 Jan 2020 15:10:19 +0100 Subject: [PATCH] add support place k8s manifests to the nodes --- defaults/main.yml | 7 +++++++ tasks/build/preconfigure-k3s-auto-deploying-manifests.yml | 5 +++++ tasks/state-installed.yml | 2 ++ 3 files changed, 14 insertions(+) create mode 100644 tasks/build/preconfigure-k3s-auto-deploying-manifests.yml diff --git a/defaults/main.yml b/defaults/main.yml index e4f27a2..87337e6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -14,6 +14,13 @@ k3s_github_url: https://github.com/rancher/k3s # Installation directory for k3s k3s_install_dir: /usr/local/bin +# Path for additional Kubernetes Manifests +# https://rancher.com/docs/k3s/latest/en/advanced/#auto-deploying-manifests +k3s_server_manifests_dir: /var/lib/rancher/k3s/server/manifests + +# a list of templates used for preconfigure the CLuster. +k3s_server_manifests_templates: [] + # Use experimental features in k3s? k3s_use_experimental: false diff --git a/tasks/build/preconfigure-k3s-auto-deploying-manifests.yml b/tasks/build/preconfigure-k3s-auto-deploying-manifests.yml new file mode 100644 index 0000000..3c76207 --- /dev/null +++ b/tasks/build/preconfigure-k3s-auto-deploying-manifests.yml @@ -0,0 +1,5 @@ +- name: Copy Auto-Deploying Manifests to Cluster Master + template: + src: "{{ item }}" + dest: "{{ k3s_server_manifests_dir }}/{{ item | basename | replace('.j2','') }}" + with_items: "{{ k3s_server_manifests_templates }}" diff --git a/tasks/state-installed.yml b/tasks/state-installed.yml index 1a71b74..d85396b 100644 --- a/tasks/state-installed.yml +++ b/tasks/state-installed.yml @@ -28,6 +28,8 @@ - import_tasks: build/download-k3s.yml +- import_tasks: build/preconfigure-k3s-auto-deploying-manifests.yml + - import_tasks: build/install-k3s.yml - import_tasks: build/configure-k3s-cluster.yml