refactor!: project updates (#1326)

* refactor!: flux is required again

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

* fix: delimiter that chomps

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

* fix: bootstrap_cloudflare logic

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

* fix: update tests

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

* fix: remove last quote

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

* chore: update readme

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

---------

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl authored and GitHub committed 2024-02-15 20:03:24 -05:00
1 parent 04ff4ef994
commit c17d543b21
93 files changed
+591 -755

No files matched your search

@@ -3,7 +3,7 @@
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-.*"]
@@ -11,9 +11,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:
@@ -24,8 +24,8 @@
- 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 %}"
loop: "{{ addons_list.resources | selectattr('metadata.name', 'match', '^custom-.*') | list }}"
@@ -13,7 +13,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
@@ -21,6 +21,6 @@
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"
replace: "https://{{ k3s_registration_address }}:6443"
@@ -9,10 +9,9 @@
- name: Extract k3s version
ansible.builtin.set_fact:
current_k3s_version: "{% raw %}{{ k3s_version.stdout | regex_replace('(?im)k3s version (?P<version>[a-z0-9\\.\\+]+).*\n.*', '\\g<version>') }}{% endraw %}"
current_k3s_version: "{{ k3s_version.stdout | regex_replace('(?im)k3s version (?P<version>[a-z0-9\\.\\+]+).*\n.*', '\\g<version>') }}"
- name: Check if upgrades are allowed
ansible.builtin.assert:
that:
- "k3s_release_version is version(current_k3s_version, '>=')"
that: ["k3s_release_version is version(current_k3s_version, '>=')"]
fail_msg: "Unable to upgrade k3s because the deployed version is higher than the one specified in the configuration"