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

+16 -17
View File
@@ -20,6 +20,7 @@
src: "{{ item.src }}"
dest: "{{ repository_path }}/ansible/{{ item.path | regex_replace('.j2$', '') }}"
mode: "0644"
lstrip_blocks: true
with_community.general.filetree:
- "../templates/ansible/shared/"
- "../templates/ansible/{{ bootstrap_distribution }}/"
@@ -27,20 +28,18 @@
label: "{{ item.path }}"
- name: Template Ansible encrypted files
block:
- name: Template Ansible encrypted files
when:
- "item.state == 'file'"
- "'sops' in item.path"
community.sops.sops_encrypt:
path: "{{ repository_path }}/ansible/{{ item.path | replace('.j2', '') }}"
encrypted_regex: ^(data|stringData)$
age: ["{{ bootstrap_age_public_key }}"]
content_yaml: "{{ lookup('ansible.builtin.template', item.src) | from_yaml }}"
mode: "0644"
force: true
with_community.general.filetree:
- "../templates/ansible/shared/"
- "../templates/ansible/{{ bootstrap_distribution }}/"
loop_control:
label: "{{ item.path }}"
when:
- "item.state == 'file'"
- "'sops' in item.path"
community.sops.sops_encrypt:
path: "{{ repository_path }}/ansible/{{ item.path | replace('.j2', '') }}"
encrypted_regex: ^(data|stringData)$
age: ["{{ bootstrap_age_public_key }}"]
content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
mode: "0644"
force: true
with_community.general.filetree:
- "../templates/ansible/shared/"
- "../templates/ansible/{{ bootstrap_distribution }}/"
loop_control:
label: "{{ item.path }}"