From 7c7333690d50a871c76389f014e7f39a0f2df085 Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Sun, 4 Sep 2022 21:41:49 +0200 Subject: [PATCH] Fix linting warning;Add annotations --- .../roles/metacluster/tasks/certauthority.yml | 16 +++++++++------- .../files/ansible_payload/templates/configmap.j2 | 2 ++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/certauthority.yml b/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/certauthority.yml index c207c37..c039255 100644 --- a/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/certauthority.yml +++ b/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/certauthority.yml @@ -35,27 +35,29 @@ _template: name: "{{ item.name }}" namespace: "{{ item.namespace }}" + annotations: "{{ item.annotations | default('{}') | indent(width=4, first=True) }}" labels: "{{ item.labels | default('{}') | indent(width=4, first=True) }}" data: "{{ item.data }}" loop: - name: argocd-tls-certs-cm namespace: argo-cd kind: configmap - labels: | + annotations: | app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: argocd-cm - app.kubernetes.io/part-of: argocd meta.helm.sh/release-name: argo-cd meta.helm.sh/release-namespace: argo-cd + labels: | + app.kubernetes.io/name: argocd-cm + app.kubernetes.io/part-of: argocd data: - - key: git.{{ vapp['metacluster.fqdn'] }} - value: "{{ stepca_cm_certs.resources[0].data['root_ca.crt'] }}" + - key: git.{{ vapp['metacluster.fqdn'] }} + value: "{{ stepca_cm_certs.resources[0].data['root_ca.crt'] }}" - name: step-certificates-certs namespace: kube-system kind: secret data: - - key: root_ca.crt - value: "{{ stepca_cm_certs.resources[0].data['root_ca.crt'] | b64encode }}" + - key: root_ca.crt + value: "{{ stepca_cm_certs.resources[0].data['root_ca.crt'] | b64encode }}" loop_control: label: "{{ item.kind + '/' + item.name + ' (' + item.namespace + ')' }}" diff --git a/ansible/roles/firstboot/files/ansible_payload/templates/configmap.j2 b/ansible/roles/firstboot/files/ansible_payload/templates/configmap.j2 index 26ad2c0..c0f6852 100644 --- a/ansible/roles/firstboot/files/ansible_payload/templates/configmap.j2 +++ b/ansible/roles/firstboot/files/ansible_payload/templates/configmap.j2 @@ -3,6 +3,8 @@ kind: ConfigMap metadata: name: {{ _template.name }} namespace: {{ _template.namespace }} + annotations: +{{ _template.annotations }} labels: {{ _template.labels }} data: