Remove git repo logic; Debug ova templates
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
ec6f712427
commit
fa0b72a903
@ -3,6 +3,7 @@
|
|||||||
gather_facts: false
|
gather_facts: false
|
||||||
vars_files:
|
vars_files:
|
||||||
- metacluster.yml
|
- metacluster.yml
|
||||||
|
- workloadcluster.yml
|
||||||
become: true
|
become: true
|
||||||
roles:
|
roles:
|
||||||
- os
|
- os
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
- name: Clone git repository
|
|
||||||
ansible.builtin.git:
|
|
||||||
repo: "{{ platform.gitops.repository.uri }}"
|
|
||||||
version: "{{ platform.gitops.repository.revision }}"
|
|
||||||
dest: /opt/metacluster/git-repositories/gitops
|
|
@ -12,11 +12,11 @@
|
|||||||
- /opt/metacluster/cluster-api/infrastructure-vsphere/{{ components.clusterapi.management.version.infrastructure_vsphere }}
|
- /opt/metacluster/cluster-api/infrastructure-vsphere/{{ components.clusterapi.management.version.infrastructure_vsphere }}
|
||||||
- /opt/metacluster/cluster-api/ipam-in-cluster/{{ components.clusterapi.management.version.ipam_incluster }}
|
- /opt/metacluster/cluster-api/ipam-in-cluster/{{ components.clusterapi.management.version.ipam_incluster }}
|
||||||
- /opt/metacluster/container-images
|
- /opt/metacluster/container-images
|
||||||
- /opt/metacluster/git-repositories/gitops
|
- /opt/metacluster/git-repositories
|
||||||
- /opt/metacluster/helm-charts
|
- /opt/metacluster/helm-charts
|
||||||
- /opt/metacluster/k3s
|
- /opt/metacluster/k3s
|
||||||
- /opt/metacluster/kube-vip
|
- /opt/metacluster/kube-vip
|
||||||
- /opt/workloadcluster/node-templates
|
- /opt/metacluster/node-templates
|
||||||
- /var/lib/rancher/k3s/agent/images
|
- /var/lib/rancher/k3s/agent/images
|
||||||
- /var/lib/rancher/k3s/server/manifests
|
- /var/lib/rancher/k3s/server/manifests
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
- name: Download node-template image
|
- name: Download node-template image
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: "{{ components.clusterapi.workload.node_template.url }}"
|
url: "{{ components.clusterapi.workload.node_template.url }}"
|
||||||
dest: /opt/workloadcluster/node-templates/{{ components.clusterapi.workload.node_template.url | basename}}
|
dest: /opt/metacluster/node-templates/{{ components.clusterapi.workload.node_template.url | basename}}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
community.vmware.vmware_guest_info:
|
community.vmware.vmware_guest_info:
|
||||||
name: "{{ (item | basename | split('.'))[:-1] | join('.') }}"
|
name: "{{ (item | basename | split('.'))[:-1] | join('.') }}"
|
||||||
register: existing_ova
|
register: existing_ova
|
||||||
loop: "{{ query('ansible.builtin.fileglob', '/opt/workloadcluster/node-templates/*.ova') | sort }}"
|
loop: "{{ query('ansible.builtin.fileglob', '/opt/metacluster/node-templates/*.ova') | first }}"
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: Parse OVA files for network mappings
|
- name: Parse OVA files for network mappings
|
||||||
@ -17,7 +17,7 @@
|
|||||||
GOVC_PASSWORD: "{{ vapp['hv.password'] }}"
|
GOVC_PASSWORD: "{{ vapp['hv.password'] }}"
|
||||||
register: ova_spec
|
register: ova_spec
|
||||||
when: existing_ova.results[index] is failed
|
when: existing_ova.results[index] is failed
|
||||||
loop: "{{ query('ansible.builtin.fileglob', '/opt/workloadcluster/node-templates/*.ova') | sort }}"
|
loop: "{{ query('ansible.builtin.fileglob', '/opt/metacluster/node-templates/*.ova') | first }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
index_var: index
|
index_var: index
|
||||||
|
|
||||||
@ -32,10 +32,15 @@
|
|||||||
ovf: "{{ item }}"
|
ovf: "{{ item }}"
|
||||||
register: ova_deploy
|
register: ova_deploy
|
||||||
when: existing_ova.results[index] is failed
|
when: existing_ova.results[index] is failed
|
||||||
loop: "{{ query('ansible.builtin.fileglob', '/opt/workloadcluster/node-templates/*.ova') | sort }}"
|
loop: "{{ query('ansible.builtin.fileglob', '/opt/metacluster/node-templates/*.ova') | first }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
index_var: index
|
index_var: index
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
msg: "{{ existing_ova.results | first }}"
|
||||||
|
- debug:
|
||||||
|
msg: "{{ ova_deploy.results | first }}"
|
||||||
|
|
||||||
- name: Add additional placeholder disk
|
- name: Add additional placeholder disk
|
||||||
community.vmware.vmware_guest_disk:
|
community.vmware.vmware_guest_disk:
|
||||||
name: "{{ item.instance.hw_name }}"
|
name: "{{ item.instance.hw_name }}"
|
||||||
|
@ -28,6 +28,10 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
storage_benchmark: "{{ [storage_benchmark, (end_time | int - start_time | int)] | max }}"
|
storage_benchmark: "{{ [storage_benchmark, (end_time | int - start_time | int)] | max }}"
|
||||||
|
|
||||||
|
- name: Log benchmark actual duration
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "Benchmark actual duration: {{ (end_time | int - start_time | int) }} second(s)"
|
||||||
|
|
||||||
- name: Mount dynamic disk
|
- name: Mount dynamic disk
|
||||||
ansible.posix.mount:
|
ansible.posix.mount:
|
||||||
path: /mnt/blockstorage
|
path: /mnt/blockstorage
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
community.vmware.vmware_guest_info:
|
community.vmware.vmware_guest_info:
|
||||||
name: "{{ (item | basename | split('.'))[:-1] | join('.') }}"
|
name: "{{ (item | basename | split('.'))[:-1] | join('.') }}"
|
||||||
register: existing_ova
|
register: existing_ova
|
||||||
loop: "{{ query('ansible.builtin.fileglob', '/opt/workloadcluster/node-templates/*.ova') | sort }}"
|
loop: "{{ query('ansible.builtin.fileglob', '/opt/workloadcluster/node-templates/*.ova') | first }}"
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: Parse OVA files for network mappings
|
- name: Parse OVA files for network mappings
|
||||||
@ -17,7 +17,7 @@
|
|||||||
GOVC_PASSWORD: "{{ vapp['hv.password'] }}"
|
GOVC_PASSWORD: "{{ vapp['hv.password'] }}"
|
||||||
register: ova_spec
|
register: ova_spec
|
||||||
when: existing_ova.results[index] is failed
|
when: existing_ova.results[index] is failed
|
||||||
loop: "{{ query('ansible.builtin.fileglob', '/opt/workloadcluster/node-templates/*.ova') | sort }}"
|
loop: "{{ query('ansible.builtin.fileglob', '/opt/workloadcluster/node-templates/*.ova') | first }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
index_var: index
|
index_var: index
|
||||||
|
|
||||||
@ -33,7 +33,7 @@
|
|||||||
ovf: "{{ item }}"
|
ovf: "{{ item }}"
|
||||||
register: ova_deploy
|
register: ova_deploy
|
||||||
when: existing_ova.results[index] is failed
|
when: existing_ova.results[index] is failed
|
||||||
loop: "{{ query('ansible.builtin.fileglob', '/opt/workloadcluster/node-templates/*.ova') | sort }}"
|
loop: "{{ query('ansible.builtin.fileglob', '/opt/workloadcluster/node-templates/*.ova') | first }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
index_var: index
|
index_var: index
|
||||||
|
|
||||||
|
@ -3,11 +3,11 @@ platform:
|
|||||||
k3s:
|
k3s:
|
||||||
version: v1.26.2+k3s1
|
version: v1.26.2+k3s1
|
||||||
|
|
||||||
gitops:
|
# gitops:
|
||||||
repository:
|
# repository:
|
||||||
uri: https://code.spamasaurus.com/djpbessems/GitOps.MetaCluster.git
|
# uri: https://code.spamasaurus.com/djpbessems/GitOps.MetaCluster.git
|
||||||
# revision: v0.1.0
|
# # revision: v0.1.0
|
||||||
revision: HEAD
|
# revision: HEAD
|
||||||
|
|
||||||
packaged_components:
|
packaged_components:
|
||||||
- name: traefik
|
- name: traefik
|
||||||
@ -216,7 +216,7 @@ components:
|
|||||||
|
|
||||||
longhorn:
|
longhorn:
|
||||||
helm:
|
helm:
|
||||||
version: 1.4.0
|
version: 1.4.1
|
||||||
chart: longhorn/longhorn
|
chart: longhorn/longhorn
|
||||||
parse_logic: cat values.yaml | yq eval '.. | select(has("repository")) | .repository + ":" + .tag'
|
parse_logic: cat values.yaml | yq eval '.. | select(has("repository")) | .repository + ":" + .tag'
|
||||||
chart_values: !unsafe |
|
chart_values: !unsafe |
|
||||||
|
15
ansible/vars/workloadcluster.yml
Normal file
15
ansible/vars/workloadcluster.yml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
downstream:
|
||||||
|
|
||||||
|
helm_repositories:
|
||||||
|
- name: longhorn
|
||||||
|
url: https://charts.longhorn.io
|
||||||
|
|
||||||
|
helm_charts:
|
||||||
|
|
||||||
|
longhorn:
|
||||||
|
version: 1.4.1
|
||||||
|
chart: longhorn/longhorn
|
||||||
|
parse_logic: cat values.yaml | yq eval '.. | select(has("repository")) | .repository + ":" + .tag'
|
||||||
|
chart_values: !unsafe |
|
||||||
|
defaultSettings:
|
||||||
|
defaultDataPath: /mnt/blockstorage
|
Loading…
Reference in New Issue
Block a user