feat: addon rss forwarder (#876)

Co-authored-by: Devin Buhl <onedr0p@users.noreply.github.com>
This commit is contained in:
AumerandDevin Buhl authored and GitHub committed 2023-08-05 09:55:34 -04:00
1 parent 0cc281e7c9
commit 3af392c008
8 files changed
+152

No files matched your search

@@ -0,0 +1,45 @@
---
- name: Set addon facts
ansible.builtin.set_fact:
addon_name: discord-template-notifier
addon_namespace: default
- name: Ensure directories exist for {{ addon_namespace }}/{{ addon_name }}
when: item.state == 'directory'
ansible.builtin.file:
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path }}"
state: directory
mode: "0755"
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
- name: Template unencrypted files for {{ addon_namespace }}/{{ addon_name }}
when: item.state == 'file' and 'sops' not in item.path
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
mode: "0644"
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
# https://github.com/ansible-collections/community.sops/issues/153
- name: Template encrypted files for {{ addon_namespace }}/{{ addon_name }}
block:
- name: Disable Sops config
ansible.builtin.include_tasks:
file: ../sops/disable.yaml
- name: Template encrypted files
when: item.state == 'file' and 'sops' in item.path
community.sops.sops_encrypt:
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ 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/addons/{{ addon_name }}/"]
- name: Enable Sops config
ansible.builtin.include_tasks:
file: ../sops/enable.yaml
rescue:
- name: Enable Sops config
ansible.builtin.include_tasks:
file: ../sops/enable.yaml
+4
View File
@@ -27,3 +27,7 @@
- name: Process addon weave-gitops
when: weave_gitops.enabled | default(false)
ansible.builtin.include_tasks: weave_gitops.yaml
- name: Process addon discord-template-notifier
when: discord_template_notifier.enabled | default(false)
ansible.builtin.include_tasks: discord_template_notifier.yaml