From 4e335b284ae4ab9781e95d0bc40368dd2fb7500b Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Sun, 20 Aug 2023 07:44:12 -0400 Subject: [PATCH] fix: add /dev/stdin as sops path_regex Signed-off-by: Devin Buhl --- bootstrap/tasks/addons/csi_driver_nfs.yaml | 11 ----------- .../tasks/addons/discord_template_notifier.yaml | 11 ----------- bootstrap/tasks/addons/grafana.yaml | 11 ----------- bootstrap/tasks/addons/hajimari.yaml | 10 ---------- bootstrap/tasks/addons/kube_prometheus_stack.yaml | 11 ----------- bootstrap/tasks/addons/kubernetes_dashboard.yaml | 11 ----------- .../tasks/addons/system_upgrade_controller.yaml | 11 ----------- bootstrap/tasks/addons/weave_gitops.yaml | 11 ----------- bootstrap/tasks/ansible/main.yaml | 10 ---------- bootstrap/tasks/kubernetes/main.yaml | 10 ---------- bootstrap/tasks/sops/disable.yaml | 12 ------------ bootstrap/tasks/sops/enable.yaml | 12 ------------ bootstrap/templates/.sops.yaml.j2 | 5 +++++ 13 files changed, 5 insertions(+), 131 deletions(-) delete mode 100644 bootstrap/tasks/sops/disable.yaml delete mode 100644 bootstrap/tasks/sops/enable.yaml diff --git a/bootstrap/tasks/addons/csi_driver_nfs.yaml b/bootstrap/tasks/addons/csi_driver_nfs.yaml index 7c2fff40..cfd0291a 100644 --- a/bootstrap/tasks/addons/csi_driver_nfs.yaml +++ b/bootstrap/tasks/addons/csi_driver_nfs.yaml @@ -20,12 +20,8 @@ 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: @@ -36,10 +32,3 @@ 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 diff --git a/bootstrap/tasks/addons/discord_template_notifier.yaml b/bootstrap/tasks/addons/discord_template_notifier.yaml index 57c988c0..734065c3 100644 --- a/bootstrap/tasks/addons/discord_template_notifier.yaml +++ b/bootstrap/tasks/addons/discord_template_notifier.yaml @@ -20,12 +20,8 @@ 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: @@ -36,10 +32,3 @@ 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 diff --git a/bootstrap/tasks/addons/grafana.yaml b/bootstrap/tasks/addons/grafana.yaml index c609be05..8ae41c2f 100644 --- a/bootstrap/tasks/addons/grafana.yaml +++ b/bootstrap/tasks/addons/grafana.yaml @@ -20,12 +20,8 @@ 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: @@ -36,10 +32,3 @@ 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 diff --git a/bootstrap/tasks/addons/hajimari.yaml b/bootstrap/tasks/addons/hajimari.yaml index ae04bfc6..c8b97610 100644 --- a/bootstrap/tasks/addons/hajimari.yaml +++ b/bootstrap/tasks/addons/hajimari.yaml @@ -23,9 +23,6 @@ # 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: @@ -36,10 +33,3 @@ 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 diff --git a/bootstrap/tasks/addons/kube_prometheus_stack.yaml b/bootstrap/tasks/addons/kube_prometheus_stack.yaml index ae38d4c9..0e7531da 100644 --- a/bootstrap/tasks/addons/kube_prometheus_stack.yaml +++ b/bootstrap/tasks/addons/kube_prometheus_stack.yaml @@ -20,12 +20,8 @@ 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: @@ -36,10 +32,3 @@ 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 diff --git a/bootstrap/tasks/addons/kubernetes_dashboard.yaml b/bootstrap/tasks/addons/kubernetes_dashboard.yaml index 95234b30..778c7967 100644 --- a/bootstrap/tasks/addons/kubernetes_dashboard.yaml +++ b/bootstrap/tasks/addons/kubernetes_dashboard.yaml @@ -20,12 +20,8 @@ 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: @@ -36,10 +32,3 @@ 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 diff --git a/bootstrap/tasks/addons/system_upgrade_controller.yaml b/bootstrap/tasks/addons/system_upgrade_controller.yaml index 13b8dd76..f3ed64b7 100644 --- a/bootstrap/tasks/addons/system_upgrade_controller.yaml +++ b/bootstrap/tasks/addons/system_upgrade_controller.yaml @@ -20,12 +20,8 @@ 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: @@ -36,10 +32,3 @@ 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 diff --git a/bootstrap/tasks/addons/weave_gitops.yaml b/bootstrap/tasks/addons/weave_gitops.yaml index d2119b8e..12d61240 100644 --- a/bootstrap/tasks/addons/weave_gitops.yaml +++ b/bootstrap/tasks/addons/weave_gitops.yaml @@ -20,12 +20,8 @@ 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: @@ -36,10 +32,3 @@ 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 diff --git a/bootstrap/tasks/ansible/main.yaml b/bootstrap/tasks/ansible/main.yaml index e5e01b81..5c5a286f 100644 --- a/bootstrap/tasks/ansible/main.yaml +++ b/bootstrap/tasks/ansible/main.yaml @@ -17,9 +17,6 @@ - name: Template Ansible encrypted files block: - - name: Disable Sops config - ansible.builtin.include_tasks: - file: ../sops/disable.yaml - name: Template Ansible encrypted files when: item.state == 'file' and 'sops' in item.path community.sops.sops_encrypt: @@ -40,10 +37,3 @@ loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}" loop_control: label: "{{ item.address }}" - - 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 diff --git a/bootstrap/tasks/kubernetes/main.yaml b/bootstrap/tasks/kubernetes/main.yaml index 8ebb1a1d..9c6f27ab 100644 --- a/bootstrap/tasks/kubernetes/main.yaml +++ b/bootstrap/tasks/kubernetes/main.yaml @@ -54,9 +54,6 @@ - name: Template Kubernetes encrypted files block: - - name: Disable Sops config - ansible.builtin.include_tasks: - file: ../sops/disable.yaml - name: Template Kubernetes encrypted files when: item.state == 'file' and 'sops' in item.path community.sops.sops_encrypt: @@ -67,10 +64,3 @@ mode: "0644" force: true with_community.general.filetree: ["../templates/kubernetes/"] - - 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 diff --git a/bootstrap/tasks/sops/disable.yaml b/bootstrap/tasks/sops/disable.yaml deleted file mode 100644 index b531c6bd..00000000 --- a/bootstrap/tasks/sops/disable.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -# https://github.com/ansible-collections/community.sops/issues/153 -- name: Rename Sops configuration file - ansible.builtin.copy: - src: "{{ repository_path }}/.sops.yaml" - dest: "{{ repository_path }}/.sops.yaml.orig" - mode: "0644" - -- name: Remove Sops configuration file - ansible.builtin.file: - path: "{{ repository_path }}/.sops.yaml" - state: absent diff --git a/bootstrap/tasks/sops/enable.yaml b/bootstrap/tasks/sops/enable.yaml deleted file mode 100644 index cb853871..00000000 --- a/bootstrap/tasks/sops/enable.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -# https://github.com/ansible-collections/community.sops/issues/153 -- name: Restore Sops configuration file - ansible.builtin.copy: - src: "{{ repository_path }}/.sops.yaml.orig" - dest: "{{ repository_path }}/.sops.yaml" - mode: "0644" - -- name: Remove backed up Sops configuration file - ansible.builtin.file: - path: "{{ repository_path }}/.sops.yaml.orig" - state: absent diff --git a/bootstrap/templates/.sops.yaml.j2 b/bootstrap/templates/.sops.yaml.j2 index 16a3a247..8a86fb3b 100644 --- a/bootstrap/templates/.sops.yaml.j2 +++ b/bootstrap/templates/.sops.yaml.j2 @@ -9,3 +9,8 @@ creation_rules: key_groups: - age: - "{{ bootstrap_age_public_key }}" + # https://github.com/ansible-collections/community.sops/issues/153 + - path_regex: /dev/stdin + key_groups: + - age: + - "{{ bootstrap_age_public_key }}"