Refactor git repo creation;Housekeeping
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
cd5fa89a0d
commit
eb2f491f72
@ -2,19 +2,27 @@
|
|||||||
|
|
||||||
- name: Aggregate chart_values into dict
|
- name: Aggregate chart_values into dict
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
chart_values: "{{ chart_values | 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 | regex_replace('[^A-Za-z0-9]', '')): { '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:
|
||||||
label: "{{ item.key }}"
|
label: "{{ item.key }}"
|
||||||
|
|
||||||
|
# - name: Aggregate chart_values into dict
|
||||||
|
# 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) } }) }}"
|
||||||
|
# when: item.value.chart_values is defined
|
||||||
|
# loop: "{{ lookup('ansible.builtin.dict', downstream.helm_charts) }}"
|
||||||
|
# loop_control:
|
||||||
|
# label: "{{ item.key }}"
|
||||||
|
|
||||||
- name: Write dict to vars_file
|
- name: Write dict to vars_file
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: /opt/firstboot/ansible/vars/metacluster.yml
|
dest: /opt/firstboot/ansible/vars/metacluster.yml
|
||||||
content: >-
|
content: >-
|
||||||
{{
|
{{
|
||||||
{ 'components': (
|
{ 'components': (
|
||||||
chart_values |
|
metacluster_chartvalues |
|
||||||
combine({ 'clusterapi': components.clusterapi }) |
|
combine({ 'clusterapi': components.clusterapi }) |
|
||||||
combine({ 'kubevip' : components.kubevip }) )
|
combine({ 'kubevip' : components.kubevip }) )
|
||||||
} | to_nice_yaml(indent=2, width=4096)
|
} | to_nice_yaml(indent=2, width=4096)
|
||||||
|
@ -1,10 +1,17 @@
|
|||||||
|
- name: Aggregate helm charts from filesystem
|
||||||
|
ansible.builtin.find:
|
||||||
|
path: /opt/workloadcluster/helm-charts
|
||||||
|
file_type: directory
|
||||||
|
recurse: false
|
||||||
|
register: helm_charts
|
||||||
|
|
||||||
- name: Create hard-links to populate new git-repository
|
- name: Create hard-links to populate new git-repository
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: >-
|
cmd: >-
|
||||||
cp -lr /opt/metacluster/helm-charts/{{ item.key }}/ /opt/workloadcluster/git-repositories/gitops/
|
cp -lr {{ item.path }}/ /opt/workloadcluster/git-repositories/gitops/
|
||||||
loop: "{{ lookup('ansible.builtin.dict', downstream.helm_charts) }}"
|
loop: "{{ helm_charts.files }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.key }}"
|
label: "{{ item.path | basename }}"
|
||||||
|
|
||||||
- name: Initialize/Push git repository
|
- name: Initialize/Push git repository
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
community.vmware.vmware_guest_disk:
|
community.vmware.vmware_guest_disk:
|
||||||
name: "{{ ova_deploy.instance.hw_name }}"
|
name: "{{ ova_deploy.instance.hw_name }}"
|
||||||
disk:
|
disk:
|
||||||
- size: 1Gb
|
- size: 1Mb
|
||||||
scsi_controller: 1
|
scsi_controller: 1
|
||||||
scsi_type: paravirtual
|
scsi_type: paravirtual
|
||||||
unit_number: 0
|
unit_number: 0
|
||||||
|
Loading…
Reference in New Issue
Block a user