feat: add support for cluster user secrets and settings (#858)

Co-authored-by: Devin Buhl <onedr0p@users.noreply.github.com>
Co-authored-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
authored and GitHub committed 2023-07-24 16:32:33 -04:00
1 parent 1a616bcff2
commit 1f55147125
6 files changed
+66 -1

No files matched your search

+38 -1
View File
@@ -8,7 +8,44 @@
with_community.general.filetree: ["../templates/kubernetes/"]
- name: Template Kubernetes unencrypted files
when: item.state == 'file' and 'sops' not in item.path and '.DS_Store' not in item.path
when:
- item.state == 'file'
- "'.DS_Store' not in item.path"
- "'sops' not in item.path"
- "'cluster-settings-user.yaml.j2' not in item.path"
- "'cluster-secrets-user.yaml.j2' not in item.path"
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/{{ item.path | regex_replace('.j2$', '') }}"
mode: "0644"
with_community.general.filetree: ["../templates/kubernetes/"]
- name: Check if the cluster user settings file already exists
stat:
path: "{{ repository_path }}/kubernetes/flux/vars/cluster-settings-user.yaml"
register: cluster_settings_user
- name: Template Kubernetes user cluster settings
when:
- item.state == 'file'
- "'cluster-settings-user.yaml' in item.path"
- not cluster_settings_user.stat.exists
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/{{ item.path | regex_replace('.j2$', '') }}"
mode: "0644"
with_community.general.filetree: ["../templates/kubernetes/"]
- name: Check if the cluster user secrets file already exists
stat:
path: "{{ repository_path }}/kubernetes/flux/vars/cluster-secrets-user.yaml"
register: cluster_secrets_user
- name: Template Kubernetes user cluster secrets
when:
- item.state == 'file'
- "'cluster-secrets-user.yaml' in item.path"
- not cluster_secrets_user.stat.exists
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/{{ item.path | regex_replace('.j2$', '') }}"