Remove regex_replace filter;Refactor dict key names;Make chart values optional
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
641ee2d9a7
commit
2b56677e9a
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
- name: Aggregate chart_values into dict
|
- name: Aggregate chart_values into dict
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
metacluster_chartvalues: "{{ metacluster_chartvalues | default({}) | combine({ (item.key | regex_replace('[^A-Za-z0-9]', '')): { 'chart_values': (item.value.helm.chart_values | from_yaml) } }) }}"
|
metacluster_chartvalues: "{{ metacluster_chartvalues | default({}) | combine({ item.key: { 'chart_values': (item.value.helm.chart_values | from_yaml) } }) }}"
|
||||||
when: item.value.helm.chart_values is defined
|
when: item.value.helm.chart_values is defined
|
||||||
loop: "{{ lookup('ansible.builtin.dict', components) }}"
|
loop: "{{ lookup('ansible.builtin.dict', components) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
- name: Aggregate chart_values into dict
|
- name: Aggregate chart_values into dict
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
workloadcluster_chartvalues: "{{ workloadcluster_chartvalues | default({}) | combine({ (item.key | regex_replace('[^A-Za-z0-9]', '')): { 'chart_values': (item.value.chart_values | from_yaml) } }) }}"
|
workloadcluster_chartvalues: "{{ workloadcluster_chartvalues | default({}) | combine({ item.key: { 'chart_values': (item.value.chart_values | from_yaml) } }) }}"
|
||||||
when: item.value.chart_values is defined
|
when: item.value.chart_values is defined
|
||||||
loop: "{{ lookup('ansible.builtin.dict', downstream.helm_charts) }}"
|
loop: "{{ lookup('ansible.builtin.dict', downstream.helm_charts) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
create_namespace: true
|
create_namespace: true
|
||||||
wait: false
|
wait: false
|
||||||
kubeconfig: "{{ kubeconfig.path }}"
|
kubeconfig: "{{ kubeconfig.path }}"
|
||||||
values: "{{ components.gitea.chart_values }}"
|
values: "{{ components['gitea'].chart_values }}"
|
||||||
|
|
||||||
- name: Ensure gitea API availability
|
- name: Ensure gitea API availability
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
create_namespace: true
|
create_namespace: true
|
||||||
wait: false
|
wait: false
|
||||||
kubeconfig: "{{ kubeconfig.path }}"
|
kubeconfig: "{{ kubeconfig.path }}"
|
||||||
values: "{{ components.argocd.chart_values }}"
|
values: "{{ components['argo-cd'].chart_values }}"
|
||||||
|
|
||||||
- name: Ensure argo-cd API availability
|
- name: Ensure argo-cd API availability
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
create_namespace: true
|
create_namespace: true
|
||||||
wait: false
|
wait: false
|
||||||
kubeconfig: "{{ kubeconfig.path }}"
|
kubeconfig: "{{ kubeconfig.path }}"
|
||||||
values: "{{ components.harbor.chart_values }}"
|
values: "{{ components['harbor'].chart_values }}"
|
||||||
|
|
||||||
- name: Ensure harbor API availability
|
- name: Ensure harbor API availability
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
create_namespace: true
|
create_namespace: true
|
||||||
wait: false
|
wait: false
|
||||||
kubeconfig: "{{ kubeconfig.path }}"
|
kubeconfig: "{{ kubeconfig.path }}"
|
||||||
values: "{{ components.longhorn.chart_values }}"
|
values: "{{ components['longhorn'].chart_values }}"
|
||||||
|
|
||||||
- name: Ensure longhorn API availability
|
- name: Ensure longhorn API availability
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
|
@ -13,10 +13,18 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.path | basename }}"
|
label: "{{ item.path | basename }}"
|
||||||
|
|
||||||
|
- name: Create subfolders
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /opt/workloadcluster/git-repositories/gitops/values/{{ item.key }}
|
||||||
|
state: directory
|
||||||
|
loop: "{{ lookup('ansible.builtin.dict', downstream_components) }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.key }}"
|
||||||
|
|
||||||
- name: Write chart values to file
|
- name: Write chart values to file
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: /opt/workloadcluster/git-repositories/gitops/values/{{ item.key }}/values.yaml
|
dest: /opt/workloadcluster/git-repositories/gitops/values/{{ item.key }}/values.yaml
|
||||||
content: "{{ item.value.chart_values }}"
|
content: "{{ item.value.chart_values | default('# Empty') }}"
|
||||||
loop: "{{ lookup('ansible.builtin.dict', downstream_components) }}"
|
loop: "{{ lookup('ansible.builtin.dict', downstream_components) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.key }}"
|
label: "{{ item.key }}"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
release_namespace: gitea
|
release_namespace: gitea
|
||||||
wait: false
|
wait: false
|
||||||
kubeconfig: "{{ kubeconfig.path }}"
|
kubeconfig: "{{ kubeconfig.path }}"
|
||||||
values: "{{ components.gitea.chart_values }}"
|
values: "{{ components['gitea'].chart_values }}"
|
||||||
|
|
||||||
- name: Ensure gitea API availability
|
- name: Ensure gitea API availability
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
release_namespace: argo-cd
|
release_namespace: argo-cd
|
||||||
wait: false
|
wait: false
|
||||||
kubeconfig: "{{ kubeconfig.path }}"
|
kubeconfig: "{{ kubeconfig.path }}"
|
||||||
values: "{{ components.argocd.chart_values }}"
|
values: "{{ components['argo-cd'].chart_values }}"
|
||||||
|
|
||||||
- name: Ensure argo-cd API availability
|
- name: Ensure argo-cd API availability
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
release_namespace: harbor
|
release_namespace: harbor
|
||||||
wait: false
|
wait: false
|
||||||
kubeconfig: "{{ kubeconfig.path }}"
|
kubeconfig: "{{ kubeconfig.path }}"
|
||||||
values: "{{ components.harbor.chart_values }}"
|
values: "{{ components['harbor'].chart_values }}"
|
||||||
|
|
||||||
- name: Ensure harbor API availability
|
- name: Ensure harbor API availability
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
release_namespace: longhorn-system
|
release_namespace: longhorn-system
|
||||||
wait: false
|
wait: false
|
||||||
kubeconfig: "{{ kubeconfig.path }}"
|
kubeconfig: "{{ kubeconfig.path }}"
|
||||||
values: "{{ components.longhorn.chart_values }}"
|
values: "{{ components['longhorn'].chart_values }}"
|
||||||
|
|
||||||
- name: Ensure longhorn API availability
|
- name: Ensure longhorn API availability
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
|
@ -22,5 +22,5 @@ downstream:
|
|||||||
chart: sealed-secrets/sealed-secrets
|
chart: sealed-secrets/sealed-secrets
|
||||||
namespace: sealed-secrets
|
namespace: sealed-secrets
|
||||||
parse_logic: helm template . | yq --no-doc eval '.. | .image? | select(.)' | sort -u | awk '!/ /'
|
parse_logic: helm template . | yq --no-doc eval '.. | .image? | select(.)' | sort -u | awk '!/ /'
|
||||||
chart_values: !unsafe |
|
# chart_values: !unsafe |
|
||||||
# Empty
|
# # Empty
|
||||||
|
Loading…
Reference in New Issue
Block a user