Fix k3s manifest (#53)

* fix(k3s): Remove manifests and folders from bootstrapped cluster
This commit is contained in:
Techno Tim 2022-08-20 16:19:20 -05:00 committed by GitHub
parent 90bbc0a399
commit cdd7c4e668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -171,3 +171,24 @@
src: /usr/local/bin/k3s
dest: /usr/local/bin/crictl
state: link
- name: Get contents of manifests folder
find:
paths: /var/lib/rancher/k3s/server/manifests
file_type: file
register: k3s_server_manifests
- name: Get sub dirs of manifests folder
find:
paths: /var/lib/rancher/k3s/server/manifests
file_type: directory
register: k3s_server_manifests_directories
- name: Remove manifests and folders that are only needed for bootstrapping cluster so k3s doesn't auto apply on start
file:
path: "{{ item.path }}"
state: absent
with_items:
- "{{ k3s_server_manifests.files }}"
- "{{ k3s_server_manifests_directories.files }}"