feat: remove the need for raw jinja blocks (#1158)

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl authored and GitHub committed 2024-01-15 00:03:41 -05:00
1 parent f9481d6202
commit e6fbc6e128
92 files changed
+430 -441

No files matched your search

@@ -1,4 +1,4 @@
{% if bootstrap_distribution == 'k3s' %}
<% if bootstrap_distribution == 'k3s' %>
---
- name: Cilium
block:
@@ -55,4 +55,4 @@
definition:
metadata:
finalizers: []
{% endif %}
<% endif %>
@@ -1,4 +1,4 @@
{% if bootstrap_distribution == 'k3s' %}
<% if bootstrap_distribution == 'k3s' %>
---
- name: Coredns
block:
@@ -55,4 +55,4 @@
definition:
metadata:
finalizers: []
{% endif %}
<% endif %>
@@ -1,11 +1,11 @@
{% if bootstrap_distribution == 'k3s' %}
<% 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: "{% raw %}{{ k3s_server_manifests_dir }}{% endraw %}"
paths: "{{ k3s_server_manifests_dir }}"
file_type: file
use_regex: true
patterns: ["^custom-.*"]
@@ -13,9 +13,9 @@
- name: Cruft | Delete custom manifests
ansible.builtin.file:
path: "{% raw %}{{ item.path }}{% endraw %}"
path: "{{ item.path }}"
state: absent
loop: "{% raw %}{{ custom_manifest.files }}{% endraw %}"
loop: "{{ custom_manifest.files }}"
- name: Cruft | Get list of custom addons
kubernetes.core.k8s_info:
@@ -26,9 +26,9 @@
- name: Cruft | Delete addons
kubernetes.core.k8s:
kubeconfig: /etc/rancher/k3s/k3s.yaml
name: "{% raw %}{{ item.metadata.name }}{% endraw %}"
name: "{{ item.metadata.name }}"
kind: Addon
namespace: kube-system
state: absent
loop: "{% raw %}{{ addons_list.resources | selectattr('metadata.name', 'match', '^custom-.*') | list }}{% endraw %}"
{% endif %}
loop: "{{ addons_list.resources | selectattr('metadata.name', 'match', '^custom-.*') | list }}"
<% endif %>
@@ -1,4 +1,4 @@
{% if bootstrap_distribution == 'k3s' %}
<% if bootstrap_distribution == 'k3s' %>
---
- name: Get absolute path to this Git repository # noqa: command-instead-of-module
ansible.builtin.command: git rev-parse --show-toplevel
@@ -14,7 +14,7 @@
when: k3s_primary_control_node
ansible.builtin.fetch:
src: /etc/rancher/k3s/k3s.yaml
dest: "{% raw %}{{ repository_path.stdout }}{% endraw %}/kubeconfig"
dest: "{{ repository_path.stdout }}/kubeconfig"
flat: true
- name: Update kubeconfig with the correct load balancer address
@@ -22,7 +22,7 @@
become: false
run_once: true
ansible.builtin.replace:
path: "{% raw %}{{ repository_path.stdout }}{% endraw %}/kubeconfig"
path: "{{ repository_path.stdout }}/kubeconfig"
regexp: https://127.0.0.1:6443
replace: "https://{% raw %}{{ k3s_registration_address }}{% endraw %}:6443"
{% endif %}
replace: "https://{{ k3s_registration_address }}:6443"
<% endif %>