feat: implement mjfilter file for templates (#1244)

* feat: implement mjfilter file for templates

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

* fix: use data.get in mjfilters

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-01-24 14:52:50 -05:00
1 parent 9d175fcc99
commit 5d849727d8
112 files changed
+81 -184

No files matched your search

@@ -1,4 +1,3 @@
#% if bootstrap_distribution in ['k0s', 'k3s'] %#
skip_list:
- yaml[commas]
- yaml[line-length]
@@ -8,4 +7,3 @@ warn_list:
- deprecated-command-syntax
- experimental
- no-changed-when
#% endif %#
+1
View File
@@ -0,0 +1 @@
main = lambda data: data.get("bootstrap_distribution") in ['k0s', 'k3s']
@@ -0,0 +1 @@
main = lambda data: data.get("bootstrap_distribution") in ['k0s', 'k3s']
@@ -0,0 +1 @@
main = lambda data: data.get("bootstrap_distribution") in ['k3s']
@@ -1,4 +1,3 @@
#% if bootstrap_distribution in ['k3s'] %#
---
# https://github.com/PyratLabs/ansible-role-k3s
# renovate: datasource=github-releases depName=k3s-io/k3s
@@ -13,4 +12,3 @@ k3s_server_manifests_templates:
- custom-cilium-helmchart.yaml
- kube-vip-ds.yaml
- kube-vip-rbac.yaml
#% endif %#
@@ -0,0 +1 @@
main = lambda data: data.get("bootstrap_distribution") in ['k3s']
@@ -1,4 +1,3 @@
#% if bootstrap_distribution in ['k3s'] %#
---
# https://rancher.com/docs/k3s/latest/en/installation/install-options/server-config/
# https://github.com/PyratLabs/ansible-role-k3s
@@ -40,4 +39,3 @@ k3s_server:
kubelet-arg:
- "image-gc-high-threshold=55"
- "image-gc-low-threshold=50"
#% endif %#
@@ -0,0 +1 @@
main = lambda data: data.get("bootstrap_distribution") in ['k3s']
@@ -1,4 +1,3 @@
#% if bootstrap_distribution in ['k3s'] %#
---
# https://rancher.com/docs/k3s/latest/en/installation/install-options/agent-config/
# https://github.com/PyratLabs/ansible-role-k3s
@@ -13,4 +12,3 @@ k3s_agent:
kubelet-arg:
- "image-gc-high-threshold=55"
- "image-gc-low-threshold=50"
#% endif %#
@@ -1,4 +1,3 @@
#% if bootstrap_distribution in ['k0s', 'k3s'] %#
---
kubernetes:
children:
@@ -18,4 +17,3 @@ kubernetes:
ansible_host: "#{ item.address }#"
#% endfor %#
#% endif %#
#% endif %#
@@ -1,4 +1,3 @@
#% if bootstrap_distribution in ['k0s', 'k3s'] %#
---
- name: Cluster kube-vip
hosts: master
@@ -28,4 +27,3 @@
dest: "/var/lib/k0s/manifests/kube-vip/kube-vip-ds.yaml"
#% endif %#
mode: preserve
#% endif %#
@@ -1,4 +1,3 @@
#% if bootstrap_distribution in ['k0s', 'k3s'] %#
---
- name: Reboot
hosts: kubernetes
@@ -14,4 +13,3 @@
ansible.builtin.reboot:
msg: Rebooting nodes
reboot_timeout: 3600
#% endif %#
@@ -1,4 +1,3 @@
#% if bootstrap_distribution in ['k0s', 'k3s'] %#
---
# https://github.com/kevincoakley/ansible-role-k8s-rolling-update
- name: Cluster rollout update
@@ -56,8 +55,7 @@
terminate_grace_period: 600
wait_timeout: 900
pod_selectors:
# Rook Ceph
- app!=rook-ceph-osd
- app!=rook-ceph-osd # Rook Ceph
delegate_to: "{{ groups['master'][0] }}"
- name: Update
@@ -87,4 +85,3 @@
#% endif %#
state: uncordon
delegate_to: "{{ groups['master'][0] }}"
#% endif %#
@@ -0,0 +1 @@
main = lambda data: data.get("bootstrap_distribution") in ['k3s']
@@ -1,4 +1,3 @@
#% if bootstrap_distribution in ['k3s'] %#
---
- name: Cilium
block:
@@ -55,4 +54,3 @@
definition:
metadata:
finalizers: []
#% endif %#
@@ -1,4 +1,3 @@
#% if bootstrap_distribution in ['k3s'] %#
---
# https://github.com/k3s-io/k3s/issues/1971
- name: Cruft
@@ -31,4 +30,3 @@
namespace: kube-system
state: absent
loop: "{{ addons_list.resources | selectattr('metadata.name', 'match', '^custom-.*') | list }}"
#% endif %#
@@ -1,4 +1,3 @@
#% if bootstrap_distribution in ['k3s'] %#
---
- name: Get absolute path to this Git repository # noqa: command-instead-of-module
ansible.builtin.command: git rev-parse --show-toplevel
@@ -25,4 +24,3 @@
path: "{{ repository_path.stdout }}/kubeconfig"
regexp: https://127.0.0.1:6443
replace: "https://{{ k3s_registration_address }}:6443"
#% endif %#
@@ -0,0 +1 @@
main = lambda data: data.get("bootstrap_distribution") in ['k3s']
@@ -1,4 +1,3 @@
#% if bootstrap_distribution in ['k3s'] %#
---
# https://docs.k3s.io/helm
apiVersion: helm.cattle.io/v1
@@ -17,4 +16,3 @@ spec:
#% filter indent(width=4, first=True) %#
#% include 'partials/cilium-values-init.partial.yaml.j2' %#
#% endfilter %#
#% endif %#
@@ -1,4 +1,2 @@
#% if bootstrap_distribution in ['k3s'] %#
---
#% include 'partials/kube-vip-ds.partial.yaml.j2' %#
#% endif %#
@@ -1,4 +1,2 @@
#% if bootstrap_distribution in ['k3s'] %#
---
#% include 'partials/kube-vip-rbac.partial.yaml.j2' %#
#% endif %#
@@ -1,7 +1,5 @@
#% if bootstrap_distribution in ['k0s', 'k3s'] %#
# Ansible
ansible-lint==6.22.2
ansible==9.1.0
jmespath==1.0.1
openshift==0.13.2
#% endif %#
@@ -1,4 +1,3 @@
#% if bootstrap_distribution in ['k0s', 'k3s'] %#
---
collections:
- name: ansible.posix
@@ -15,4 +14,3 @@ roles:
src: https://github.com/PyratLabs/ansible-role-k3s
version: v3.4.3
#% endif %#
#% endif %#