Reduce loop list length;Test vApp properties
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
4d2513c1a5
commit
b8cb76e7ac
@ -0,0 +1,24 @@
|
|||||||
|
- name: Check for expected vApp properties
|
||||||
|
ansible.builtin.assert:
|
||||||
|
that:
|
||||||
|
- vapp[item] is defined
|
||||||
|
- (vapp[item] | length) > 0
|
||||||
|
loop:
|
||||||
|
- deployment.type
|
||||||
|
- guestinfo.dnsserver
|
||||||
|
- guestinfo.gateway
|
||||||
|
- guestinfo.hostname
|
||||||
|
- guestinfo.ipaddress
|
||||||
|
- guestinfo.prefixlength
|
||||||
|
- guestinfo.rootsshkey
|
||||||
|
- hv.fqdn
|
||||||
|
- hv.password
|
||||||
|
- hv.username
|
||||||
|
- ippool.endip
|
||||||
|
- ippool.startip
|
||||||
|
- metacluster.fqdn
|
||||||
|
- metacluster.password
|
||||||
|
- metacluster.token
|
||||||
|
- metacluster.vip
|
||||||
|
- workloadcluster.name
|
||||||
|
- workloadcluster.vip
|
@ -54,18 +54,20 @@
|
|||||||
|
|
||||||
- name: WORKAROUND - Update image references to use local registry
|
- name: WORKAROUND - Update image references to use local registry
|
||||||
ansible.builtin.replace:
|
ansible.builtin.replace:
|
||||||
dest: "{{ item.root ~ '/' ~ item.path }}"
|
dest: "{{ item }}"
|
||||||
regexp: '([ ]+image:[ "]+)(?!({{ _template.pattern }}|"{{ _template.pattern }}))'
|
regexp: '([ ]+image:[ "]+)(?!({{ _template.pattern }}|"{{ _template.pattern }}))'
|
||||||
replace: '\1{{ _template.pattern }}'
|
replace: '\1{{ _template.pattern }}'
|
||||||
vars:
|
vars:
|
||||||
|
fileglobs:
|
||||||
|
- "{{ query('ansible.builtin.fileglob', '/opt/metacluster/cluster-api/cni-calico/' ~ components.clusterapi.workload.version.calico ~ '/*.yaml') }}"
|
||||||
|
- "{{ query('ansible.builtin.fileglob', '/opt/metacluster/cluster-api/infrastructure-vsphere/' ~ components.clusterapi.management.version.infrastructure_vsphere ~ '/*.yaml') }}"
|
||||||
_template:
|
_template:
|
||||||
pattern: registry.{{ vapp['metacluster.fqdn'] }}/library/
|
pattern: registry.{{ vapp['metacluster.fqdn'] }}/library/
|
||||||
loop: "{{ lookup('community.general.filetree', '/opt/metacluster/cluster-api') }}"
|
loop: "{{ fileglobs[0:] | flatten | select }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.path }}"
|
label: "{{ item | basename }}"
|
||||||
when:
|
when:
|
||||||
- item.path is search('.yaml')
|
- item is not search("components.yaml|metadata.yaml")
|
||||||
- item.path is not search("cert-manager.yaml|clusterctl.yaml|components.yaml|metadata.yaml")
|
|
||||||
|
|
||||||
- name: Generate kustomization template
|
- name: Generate kustomization template
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
@ -1 +1,2 @@
|
|||||||
|
- import_tasks: vapp.yml
|
||||||
- import_tasks: vcenter.yml
|
- import_tasks: vcenter.yml
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
|
- import_tasks: vapp.yml
|
||||||
- import_tasks: vcenter.yml
|
- import_tasks: vcenter.yml
|
||||||
- import_tasks: metacluster.yml
|
- import_tasks: metacluster.yml
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
- name: Check for expected vApp properties
|
||||||
|
ansible.builtin.assert:
|
||||||
|
that:
|
||||||
|
- vapp[item] is defined
|
||||||
|
- (vapp[item] | length) > 0
|
||||||
|
loop:
|
||||||
|
- guestinfo.dnsserver
|
||||||
|
- guestinfo.gateway
|
||||||
|
- guestinfo.hostname
|
||||||
|
- guestinfo.ipaddress
|
||||||
|
- guestinfo.prefixlength
|
||||||
|
- guestinfo.rootsshkey
|
||||||
|
- hv.fqdn
|
||||||
|
- hv.password
|
||||||
|
- hv.username
|
||||||
|
- metacluster.fqdn
|
||||||
|
- metacluster.password
|
||||||
|
- metacluster.token
|
||||||
|
- metacluster.vip
|
Loading…
Reference in New Issue
Block a user