feat: set lstrip on ansible template task and remove comments (#1155)

* feat: set lstrip on ansible template task and remove comments

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

* fix: cert-manager block was neing stripped

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-14 17:08:59 -05:00
1 parent ef44ea1b2b
commit a4731906d9
82 files changed
+166 -244

No files matched your search

+13 -14
View File
@@ -20,21 +20,20 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
mode: "0644" mode: "0644"
lstrip_blocks: true
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
loop_control: loop_control:
label: "{{ item.path }}" label: "{{ item.path }}"
- name: Template encrypted files for {{ addon_namespace }}/{{ addon_name }} - name: Template encrypted files
block: when: item.state == 'file' and 'sops' in item.path
- name: Template encrypted files community.sops.sops_encrypt:
when: item.state == 'file' and 'sops' in item.path path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
community.sops.sops_encrypt: encrypted_regex: ^(data|stringData)$
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" age: ["{{ bootstrap_age_public_key }}"]
encrypted_regex: ^(data|stringData)$ content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
age: ["{{ bootstrap_age_public_key }}"] mode: "0644"
content_yaml: "{{ lookup('ansible.builtin.template', item.src) | from_yaml }}" force: true
mode: "0644" with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
force: true loop_control:
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] label: "{{ item.path }}"
loop_control:
label: "{{ item.path }}"
+13 -14
View File
@@ -20,21 +20,20 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
mode: "0644" mode: "0644"
lstrip_blocks: true
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
loop_control: loop_control:
label: "{{ item.path }}" label: "{{ item.path }}"
- name: Template encrypted files for {{ addon_namespace }}/{{ addon_name }} - name: Template encrypted files
block: when: item.state == 'file' and 'sops' in item.path
- name: Template encrypted files community.sops.sops_encrypt:
when: item.state == 'file' and 'sops' in item.path path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
community.sops.sops_encrypt: encrypted_regex: ^(data|stringData)$
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" age: ["{{ bootstrap_age_public_key }}"]
encrypted_regex: ^(data|stringData)$ content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
age: ["{{ bootstrap_age_public_key }}"] mode: "0644"
content_yaml: "{{ lookup('ansible.builtin.template', item.src) | from_yaml }}" force: true
mode: "0644" with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
force: true loop_control:
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] label: "{{ item.path }}"
loop_control:
label: "{{ item.path }}"
@@ -20,21 +20,20 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
mode: "0644" mode: "0644"
lstrip_blocks: true
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
loop_control: loop_control:
label: "{{ item.path }}" label: "{{ item.path }}"
- name: Template encrypted files for {{ addon_namespace }}/{{ addon_name }} - name: Template encrypted files
block: when: item.state == 'file' and 'sops' in item.path
- name: Template encrypted files community.sops.sops_encrypt:
when: item.state == 'file' and 'sops' in item.path path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
community.sops.sops_encrypt: encrypted_regex: ^(data|stringData)$
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" age: ["{{ bootstrap_age_public_key }}"]
encrypted_regex: ^(data|stringData)$ content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
age: ["{{ bootstrap_age_public_key }}"] mode: "0644"
content_yaml: "{{ lookup('ansible.builtin.template', item.src) | from_yaml }}" force: true
mode: "0644" with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
force: true loop_control:
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] label: "{{ item.path }}"
loop_control:
label: "{{ item.path }}"
+13 -14
View File
@@ -20,21 +20,20 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
mode: "0644" mode: "0644"
lstrip_blocks: true
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
loop_control: loop_control:
label: "{{ item.path }}" label: "{{ item.path }}"
- name: Template encrypted files for {{ addon_namespace }}/{{ addon_name }} - name: Template encrypted files
block: when: item.state == 'file' and 'sops' in item.path
- name: Template encrypted files community.sops.sops_encrypt:
when: item.state == 'file' and 'sops' in item.path path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
community.sops.sops_encrypt: encrypted_regex: ^(data|stringData)$
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" age: ["{{ bootstrap_age_public_key }}"]
encrypted_regex: ^(data|stringData)$ content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
age: ["{{ bootstrap_age_public_key }}"] mode: "0644"
content_yaml: "{{ lookup('ansible.builtin.template', item.src) | from_yaml }}" force: true
mode: "0644" with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
force: true loop_control:
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] label: "{{ item.path }}"
loop_control:
label: "{{ item.path }}"
+13 -15
View File
@@ -20,22 +20,20 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
mode: "0644" mode: "0644"
lstrip_blocks: true
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
loop_control: loop_control:
label: "{{ item.path }}" label: "{{ item.path }}"
# https://github.com/ansible-collections/community.sops/issues/153 - name: Template encrypted files
- name: Template encrypted files for {{ addon_namespace }}/{{ addon_name }} when: item.state == 'file' and 'sops' in item.path
block: community.sops.sops_encrypt:
- name: Template encrypted files path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
when: item.state == 'file' and 'sops' in item.path encrypted_regex: ^(data|stringData)$
community.sops.sops_encrypt: age: ["{{ bootstrap_age_public_key }}"]
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
encrypted_regex: ^(data|stringData)$ mode: "0644"
age: ["{{ bootstrap_age_public_key }}"] force: true
content_yaml: "{{ lookup('ansible.builtin.template', item.src) | from_yaml }}" with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
mode: "0644" loop_control:
force: true label: "{{ item.path }}"
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
loop_control:
label: "{{ item.path }}"
@@ -20,21 +20,20 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
mode: "0644" mode: "0644"
lstrip_blocks: true
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
loop_control: loop_control:
label: "{{ item.path }}" label: "{{ item.path }}"
- name: Template encrypted files for {{ addon_namespace }}/{{ addon_name }} - name: Template encrypted files
block: when: item.state == 'file' and 'sops' in item.path
- name: Template encrypted files community.sops.sops_encrypt:
when: item.state == 'file' and 'sops' in item.path path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
community.sops.sops_encrypt: encrypted_regex: ^(data|stringData)$
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" age: ["{{ bootstrap_age_public_key }}"]
encrypted_regex: ^(data|stringData)$ content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
age: ["{{ bootstrap_age_public_key }}"] mode: "0644"
content_yaml: "{{ lookup('ansible.builtin.template', item.src) | from_yaml }}" force: true
mode: "0644" with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
force: true loop_control:
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] label: "{{ item.path }}"
loop_control:
label: "{{ item.path }}"
@@ -20,21 +20,20 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
mode: "0644" mode: "0644"
lstrip_blocks: true
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
loop_control: loop_control:
label: "{{ item.path }}" label: "{{ item.path }}"
- name: Template encrypted files for {{ addon_namespace }}/{{ addon_name }} - name: Template encrypted files
block: when: item.state == 'file' and 'sops' in item.path
- name: Template encrypted files community.sops.sops_encrypt:
when: item.state == 'file' and 'sops' in item.path path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
community.sops.sops_encrypt: encrypted_regex: ^(data|stringData)$
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" age: ["{{ bootstrap_age_public_key }}"]
encrypted_regex: ^(data|stringData)$ content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
age: ["{{ bootstrap_age_public_key }}"] mode: "0644"
content_yaml: "{{ lookup('ansible.builtin.template', item.src) | from_yaml }}" force: true
mode: "0644" with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
force: true loop_control:
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] label: "{{ item.path }}"
loop_control:
label: "{{ item.path }}"
@@ -20,21 +20,20 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
mode: "0644" mode: "0644"
lstrip_blocks: true
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
loop_control: loop_control:
label: "{{ item.path }}" label: "{{ item.path }}"
- name: Template encrypted files for {{ addon_namespace }}/{{ addon_name }} - name: Template encrypted files
block: when: item.state == 'file' and 'sops' in item.path
- name: Template encrypted files community.sops.sops_encrypt:
when: item.state == 'file' and 'sops' in item.path path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
community.sops.sops_encrypt: encrypted_regex: ^(data|stringData)$
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" age: ["{{ bootstrap_age_public_key }}"]
encrypted_regex: ^(data|stringData)$ content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
age: ["{{ bootstrap_age_public_key }}"] mode: "0644"
content_yaml: "{{ lookup('ansible.builtin.template', item.src) | from_yaml }}" force: true
mode: "0644" with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
force: true loop_control:
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] label: "{{ item.path }}"
loop_control:
label: "{{ item.path }}"
+13 -14
View File
@@ -20,21 +20,20 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
mode: "0644" mode: "0644"
lstrip_blocks: true
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
loop_control: loop_control:
label: "{{ item.path }}" label: "{{ item.path }}"
- name: Template encrypted files for {{ addon_namespace }}/{{ addon_name }} - name: Template encrypted files
block: when: item.state == 'file' and 'sops' in item.path
- name: Template encrypted files community.sops.sops_encrypt:
when: item.state == 'file' and 'sops' in item.path path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
community.sops.sops_encrypt: encrypted_regex: ^(data|stringData)$
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" age: ["{{ bootstrap_age_public_key }}"]
encrypted_regex: ^(data|stringData)$ content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
age: ["{{ bootstrap_age_public_key }}"] mode: "0644"
content_yaml: "{{ lookup('ansible.builtin.template', item.src) | from_yaml }}" force: true
mode: "0644" with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
force: true loop_control:
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] label: "{{ item.path }}"
loop_control:
label: "{{ item.path }}"
+13 -14
View File
@@ -20,21 +20,20 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
mode: "0644" mode: "0644"
lstrip_blocks: true
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
loop_control: loop_control:
label: "{{ item.path }}" label: "{{ item.path }}"
- name: Template encrypted files for {{ addon_namespace }}/{{ addon_name }} - name: Template encrypted files
block: when: item.state == 'file' and 'sops' in item.path
- name: Template encrypted files community.sops.sops_encrypt:
when: item.state == 'file' and 'sops' in item.path path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
community.sops.sops_encrypt: encrypted_regex: ^(data|stringData)$
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}" age: ["{{ bootstrap_age_public_key }}"]
encrypted_regex: ^(data|stringData)$ content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
age: ["{{ bootstrap_age_public_key }}"] mode: "0644"
content_yaml: "{{ lookup('ansible.builtin.template', item.src) | from_yaml }}" force: true
mode: "0644" with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
force: true loop_control:
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"] label: "{{ item.path }}"
loop_control:
label: "{{ item.path }}"
+16 -17
View File
@@ -20,6 +20,7 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ repository_path }}/ansible/{{ item.path | regex_replace('.j2$', '') }}" dest: "{{ repository_path }}/ansible/{{ item.path | regex_replace('.j2$', '') }}"
mode: "0644" mode: "0644"
lstrip_blocks: true
with_community.general.filetree: with_community.general.filetree:
- "../templates/ansible/shared/" - "../templates/ansible/shared/"
- "../templates/ansible/{{ bootstrap_distribution }}/" - "../templates/ansible/{{ bootstrap_distribution }}/"
@@ -27,20 +28,18 @@
label: "{{ item.path }}" label: "{{ item.path }}"
- name: Template Ansible encrypted files - name: Template Ansible encrypted files
block: when:
- name: Template Ansible encrypted files - "item.state == 'file'"
when: - "'sops' in item.path"
- "item.state == 'file'" community.sops.sops_encrypt:
- "'sops' in item.path" path: "{{ repository_path }}/ansible/{{ item.path | replace('.j2', '') }}"
community.sops.sops_encrypt: encrypted_regex: ^(data|stringData)$
path: "{{ repository_path }}/ansible/{{ item.path | replace('.j2', '') }}" age: ["{{ bootstrap_age_public_key }}"]
encrypted_regex: ^(data|stringData)$ content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
age: ["{{ bootstrap_age_public_key }}"] mode: "0644"
content_yaml: "{{ lookup('ansible.builtin.template', item.src) | from_yaml }}" force: true
mode: "0644" with_community.general.filetree:
force: true - "../templates/ansible/shared/"
with_community.general.filetree: - "../templates/ansible/{{ bootstrap_distribution }}/"
- "../templates/ansible/shared/" loop_control:
- "../templates/ansible/{{ bootstrap_distribution }}/" label: "{{ item.path }}"
loop_control:
label: "{{ item.path }}"
+1
View File
@@ -4,3 +4,4 @@
src: "templates/k0s/k0s-config.yaml.j2" src: "templates/k0s/k0s-config.yaml.j2"
dest: "{{ repository_path }}/k0s-config.yaml" dest: "{{ repository_path }}/k0s-config.yaml"
mode: "0644" mode: "0644"
lstrip_blocks: true
+16 -15
View File
@@ -20,6 +20,7 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/{{ item.path | regex_replace('.j2$', '') }}" dest: "{{ repository_path }}/kubernetes/{{ item.path | regex_replace('.j2$', '') }}"
mode: "0644" mode: "0644"
lstrip_blocks: true
with_community.general.filetree: ["../templates/kubernetes/"] with_community.general.filetree: ["../templates/kubernetes/"]
loop_control: loop_control:
label: "{{ item.path }}" label: "{{ item.path }}"
@@ -38,6 +39,7 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/{{ item.path | regex_replace('.j2$', '') }}" dest: "{{ repository_path }}/kubernetes/{{ item.path | regex_replace('.j2$', '') }}"
mode: "0644" mode: "0644"
lstrip_blocks: true
with_community.general.filetree: ["../templates/kubernetes/"] with_community.general.filetree: ["../templates/kubernetes/"]
loop_control: loop_control:
label: "{{ item.path }}" label: "{{ item.path }}"
@@ -56,23 +58,22 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/{{ item.path | regex_replace('.j2$', '') }}" dest: "{{ repository_path }}/kubernetes/{{ item.path | regex_replace('.j2$', '') }}"
mode: "0644" mode: "0644"
lstrip_blocks: true
with_community.general.filetree: ["../templates/kubernetes/"] with_community.general.filetree: ["../templates/kubernetes/"]
loop_control: loop_control:
label: "{{ item.path }}" label: "{{ item.path }}"
- name: Template Kubernetes encrypted files - name: Template Kubernetes encrypted files
block: when:
- name: Template Kubernetes encrypted files - "item.state == 'file'"
when: - "'sops' in item.path"
- "item.state == 'file'" community.sops.sops_encrypt:
- "'sops' in item.path" path: "{{ repository_path }}/kubernetes/{{ item.path | replace('.j2', '') }}"
community.sops.sops_encrypt: encrypted_regex: ^(data|stringData)$
path: "{{ repository_path }}/kubernetes/{{ item.path | replace('.j2', '') }}" age: ["{{ bootstrap_age_public_key }}"]
encrypted_regex: ^(data|stringData)$ content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
age: ["{{ bootstrap_age_public_key }}"] mode: "0644"
content_yaml: "{{ lookup('ansible.builtin.template', item.src) | from_yaml }}" force: true
mode: "0644" with_community.general.filetree: ["../templates/kubernetes/"]
force: true loop_control:
with_community.general.filetree: ["../templates/kubernetes/"] label: "{{ item.path }}"
loop_control:
label: "{{ item.path }}"
+1
View File
@@ -4,3 +4,4 @@
src: "templates/.sops.yaml.j2" src: "templates/.sops.yaml.j2"
dest: "{{ repository_path }}/.sops.yaml" dest: "{{ repository_path }}/.sops.yaml"
mode: "0644" mode: "0644"
lstrip_blocks: true
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: helm.toolkit.fluxcd.io/v2beta2 apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease kind: HelmRelease
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.toolkit.fluxcd.io/v1 apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: helm.toolkit.fluxcd.io/v2beta2 apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease kind: HelmRelease
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
{% for item in csi_driver_nfs.storage_class %} {% for item in csi_driver_nfs.storage_class %}
--- ---
apiVersion: storage.k8s.io/v1 apiVersion: storage.k8s.io/v1
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.toolkit.fluxcd.io/v1 apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: helm.toolkit.fluxcd.io/v2beta2 apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease kind: HelmRelease
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.toolkit.fluxcd.io/v1 apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: helm.toolkit.fluxcd.io/v2beta2 apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease kind: HelmRelease
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: helm.toolkit.fluxcd.io/v2beta2 apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease kind: HelmRelease
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.toolkit.fluxcd.io/v1 apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: helm.toolkit.fluxcd.io/v2beta2 apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease kind: HelmRelease
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.toolkit.fluxcd.io/v1 apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: helm.toolkit.fluxcd.io/v2beta2 apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease kind: HelmRelease
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
# For dashboard sign in token: # For dashboard sign in token:
# kubectl -n observability get secret kubernetes-dashboard -o jsonpath='{.data.token}' | base64 -d # kubectl -n observability get secret kubernetes-dashboard -o jsonpath='{.data.token}' | base64 -d
--- ---
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.toolkit.fluxcd.io/v1 apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: helm.toolkit.fluxcd.io/v2beta2 apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease kind: HelmRelease
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.toolkit.fluxcd.io/v1 apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: upgrade.cattle.io/v1 apiVersion: upgrade.cattle.io/v1
kind: Plan kind: Plan
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: upgrade.cattle.io/v1 apiVersion: upgrade.cattle.io/v1
kind: Plan kind: Plan
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: helm.toolkit.fluxcd.io/v2beta2 apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease kind: HelmRelease
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.toolkit.fluxcd.io/v1 apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: helm.toolkit.fluxcd.io/v2beta2 apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease kind: HelmRelease
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: helm.toolkit.fluxcd.io/v2beta2 apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease kind: HelmRelease
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.toolkit.fluxcd.io/v1 apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
# #
# Below vars are for the xanmanning.k3s role # Below vars are for the xanmanning.k3s role
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
# https://rancher.com/docs/k3s/latest/en/installation/install-options/server-config/ # https://rancher.com/docs/k3s/latest/en/installation/install-options/server-config/
# https://github.com/PyratLabs/ansible-role-k3s # https://github.com/PyratLabs/ansible-role-k3s
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
# https://rancher.com/docs/k3s/latest/en/installation/install-options/agent-config/ # https://rancher.com/docs/k3s/latest/en/installation/install-options/agent-config/
# https://github.com/PyratLabs/ansible-role-k3s # https://github.com/PyratLabs/ansible-role-k3s
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
- name: Cluster Installation - name: Cluster Installation
hosts: kubernetes hosts: kubernetes
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
# https://docs.k3s.io/helm # https://docs.k3s.io/helm
apiVersion: helm.cattle.io/v1 apiVersion: helm.cattle.io/v1
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
# https://docs.k3s.io/helm # https://docs.k3s.io/helm
apiVersion: helm.cattle.io/v1 apiVersion: helm.cattle.io/v1
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
timezone: "{{ bootstrap_timezone }}" timezone: "{{ bootstrap_timezone }}"
github_username: "{{ bootstrap_github_username }}" github_username: "{{ bootstrap_github_username }}"
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
kubernetes: kubernetes:
children: children:
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
- name: Cluster Nuke - name: Cluster Nuke
hosts: kubernetes hosts: kubernetes
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
- name: Prepare System - name: Prepare System
hosts: kubernetes hosts: kubernetes
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
- name: Reboot - name: Reboot
hosts: kubernetes hosts: kubernetes
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
# https://github.com/kevincoakley/ansible-role-k8s-rolling-update # https://github.com/kevincoakley/ansible-role-k8s-rolling-update
- name: Cluster rollout update - name: Cluster rollout update
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: k0sctl.k0sproject.io/v1beta1 apiVersion: k0sctl.k0sproject.io/v1beta1
kind: Cluster kind: Cluster
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True
--- ---
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule kind: PrometheusRule
@@ -29,9 +28,8 @@ spec:
severity: warning severity: warning
annotations: annotations:
description: > description: >
The domain that this cert covers will be unavailable after The domain that this cert covers will be unavailable after {% raw %}{{ $value | humanizeDuration }}{% endraw %}.
{% raw %}{{ $value | humanizeDuration }}{% endraw %}. Clients using endpoints that this cert Clients using endpoints that this cert protects will start to fail in {% raw %}{{ $value | humanizeDuration }}{% endraw %}.
protects will start to fail in {% raw %}{{ $value | humanizeDuration }}{% endraw %}.
runbook_url: https://gitlab.com/uneeq-oss/cert-manager-mixin/-/blob/master/RUNBOOK.md#certmanagercertexpirysoon runbook_url: https://gitlab.com/uneeq-oss/cert-manager-mixin/-/blob/master/RUNBOOK.md#certmanagercertexpirysoon
summary: | summary: |
The cert {% raw %}{{ $labels.name }}{% endraw %} is {% raw %}{{ $value | humanizeDuration }}{% endraw %} from expiry, it should have renewed over a week ago. The cert {% raw %}{{ $labels.name }}{% endraw %} is {% raw %}{{ $value | humanizeDuration }}{% endraw %} from expiry, it should have renewed over a week ago.
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: helm.toolkit.fluxcd.io/v2beta2 apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease kind: HelmRelease
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: helm.toolkit.fluxcd.io/v2beta2 apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease kind: HelmRelease
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: helm.toolkit.fluxcd.io/v2beta2 apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease kind: HelmRelease
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: source.toolkit.fluxcd.io/v1 apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository kind: GitRepository
@@ -1,4 +1,3 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap