feat: do not template out k3s ansible when k0s is choosen

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl committed 2024-01-11 16:46:36 -05:00
1 parent 8e7d36c0c5
commit c8ebab7508
29 files changed
+33 -15

No files matched your search

+17 -7
View File
@@ -1,24 +1,33 @@
---
- name: Ensure Kubernetes directories exist
- name: Ensure Ansible k3s directories exist
when: item.state == 'directory'
ansible.builtin.file:
path: "{{ repository_path }}/ansible/{{ item.path }}"
state: directory
mode: "0755"
with_community.general.filetree: ["../templates/ansible/"]
with_community.general.filetree:
- "../templates/ansible/shared/"
- "../templates/ansible/{{ bootstrap_distribution }}/"
- name: Template Ansible unencrypted files
when: item.state == 'file' and 'sops' not in item.path and '.DS_Store' not in item.path
when:
- "item.state == 'file'"
- "'sops' not in item.path"
- "'.DS_Store' not in item.path"
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ repository_path }}/ansible/{{ item.path | regex_replace('.j2$', '') }}"
mode: "0644"
with_community.general.filetree: ["../templates/ansible/"]
with_community.general.filetree:
- "../templates/ansible/shared/"
- "../templates/ansible/{{ bootstrap_distribution }}/"
- name: Template Ansible encrypted files
block:
- name: Template Ansible encrypted files
when: item.state == 'file' and 'sops' in 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)$
@@ -26,5 +35,6 @@
content_yaml: "{{ lookup('ansible.builtin.template', item.src) | from_yaml }}"
mode: "0644"
force: true
with_community.general.filetree: ["../templates/ansible/"]
with_community.general.filetree:
- "../templates/ansible/shared/"
- "../templates/ansible/{{ bootstrap_distribution }}/"