Files
home-cluster/bootstrap/templates/ansible/playbooks/tasks/cruft.yaml.j2
T
Devin Buhl 93c9d21581 feat: change jinja block/start delimiters for renovate support (#1163)
* feat: change jinja block/start delimiters for renovate support

Signed-off-by: Devin Buhl <devin@buhl.casa>

* fix: update renovate config an helm repos

Signed-off-by: Devin Buhl <devin@buhl.casa>

---------

Signed-off-by: Devin Buhl <devin@buhl.casa>
2024-01-15 19:31:45 -05:00

35 lines
1.0 KiB
YAML

#% if bootstrap_distribution == 'k3s' %#
---
# https://github.com/k3s-io/k3s/issues/1971
- name: Cruft
block:
- name: Cruft | Get list of custom manifests
ansible.builtin.find:
paths: "{{ k3s_server_manifests_dir }}"
file_type: file
use_regex: true
patterns: ["^custom-.*"]
register: custom_manifest
- name: Cruft | Delete custom manifests
ansible.builtin.file:
path: "{{ item.path }}"
state: absent
loop: "{{ custom_manifest.files }}"
- name: Cruft | Get list of custom addons
kubernetes.core.k8s_info:
kubeconfig: /etc/rancher/k3s/k3s.yaml
kind: Addon
register: addons_list
- name: Cruft | Delete addons
kubernetes.core.k8s:
kubeconfig: /etc/rancher/k3s/k3s.yaml
name: "{{ item.metadata.name }}"
kind: Addon
namespace: kube-system
state: absent
loop: "{{ addons_list.resources | selectattr('metadata.name', 'match', '^custom-.*') | list }}"
#% endif %#