From abacbf90ce667a89cf20945ecc8fb157485f8044 Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Sat, 9 Jul 2022 12:35:29 +0200 Subject: [PATCH] Refine templating #5 --- .../roles/metacluster/tasks/components.yml | 2 +- ansible/vars/metacluster.yml | 66 +++++++++---------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/ansible/roles/metacluster/tasks/components.yml b/ansible/roles/metacluster/tasks/components.yml index daf6e57..a665ab1 100644 --- a/ansible/roles/metacluster/tasks/components.yml +++ b/ansible/roles/metacluster/tasks/components.yml @@ -25,7 +25,7 @@ - name: Aggregate chart_values into dict ansible.builtin.set_fact: - chart_values: "{{ chart_values | default({}) | combine({ item.key: (item.value.helm.chart_values | default('~')) }) }}" + chart_values: "{{ chart_values | default({}) | combine({ item.key: { 'chart_values': (item.value.helm.chart_values | default('~')) } }) }}" loop: "{{ lookup('ansible.builtin.dict', components) }}" loop_control: label: "{{ item.key }}" diff --git a/ansible/vars/metacluster.yml b/ansible/vars/metacluster.yml index ee3b20c..43eefac 100644 --- a/ansible/vars/metacluster.yml +++ b/ansible/vars/metacluster.yml @@ -20,51 +20,51 @@ components: version: 1.3.0 chart: longhorn/longhorn parse_logic: cat values.yaml | yq eval '.. | select(has("repository")) | .repository + ":" + .tag' - chart_values: |4 - defaultSettings: - defaultDataPath: /mnt/blockstorage - defaultReplicaCount: 1 - ingress: - enabled: true - host: storage.[% vapp['metacluster.fqdn'] %] - persistence: - defaultClassReplicaCount: 1 + chart_values: + defaultSettings: + defaultDataPath: /mnt/blockstorage + defaultReplicaCount: 1 + ingress: + enabled: true + host: storage.[% vapp['metacluster.fqdn'] %] + persistence: + defaultClassReplicaCount: 1 harbor: helm: version: 1.9.1 # (= Harbor v2.5.1) chart: harbor/harbor parse_logic: helm template . | yq --no-doc eval '.. | .image? | select(.)' | sort -u | awk '!/ /' - chart_values: |4 - expose: - ingress: - hosts: - core: registry.[% vapp['metacluster.fqdn'] %] - externalURL: https://registry.[% vapp['metacluster.fqdn'] %] - harborAdminPassword: "[% vapp['guestinfo.rootpw'] %]" - notary: - enabled: false + chart_values: + expose: + ingress: + hosts: + core: registry.[% vapp['metacluster.fqdn'] %] + externalURL: https://registry.[% vapp['metacluster.fqdn'] %] + harborAdminPassword: "[% vapp['guestinfo.rootpw'] %]" + notary: + enabled: false gitea: helm: version: v5.0.9 # (= Gitea v1.16.8) chart: gitea-charts/gitea parse_logic: helm template . | yq --no-doc eval '.. | .image? | select(.)' | sort -u | sed '/:/!s/$/:latest/' - chart_values: |4 - gitea: - admin: - username: administrator - password: "[% vapp['guestinfo.rootpw'] %]" - email: admin@[% vapp['metacluster.fqdn'] %] - image: - pullPolicy: IfNotPresent - ingress: - enabled: true - hosts: - - host: git.[% vapp['metacluster.fqdn'] %] - paths: - - path: / - pathType: Prefix + chart_values: + gitea: + admin: + username: administrator + password: "[% vapp['guestinfo.rootpw'] %]" + email: admin@[% vapp['metacluster.fqdn'] %] + image: + pullPolicy: IfNotPresent + ingress: + enabled: true + hosts: + - host: git.[% vapp['metacluster.fqdn'] %] + paths: + - path: / + pathType: Prefix argo-cd: helm: