Remove git repo logic; Debug ova templates
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2023-03-25 16:58:23 +01:00
parent ec6f712427
commit fa0b72a903
9 changed files with 40 additions and 20 deletions

View File

@ -3,6 +3,7 @@
gather_facts: false
vars_files:
- metacluster.yml
- workloadcluster.yml
become: true
roles:
- os

View File

@ -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

View File

@ -12,11 +12,11 @@
- /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/container-images
- /opt/metacluster/git-repositories/gitops
- /opt/metacluster/git-repositories
- /opt/metacluster/helm-charts
- /opt/metacluster/k3s
- /opt/metacluster/kube-vip
- /opt/workloadcluster/node-templates
- /opt/metacluster/node-templates
- /var/lib/rancher/k3s/agent/images
- /var/lib/rancher/k3s/server/manifests

View File

@ -1,4 +1,4 @@
- name: Download node-template image
ansible.builtin.uri:
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}}

View File

@ -4,7 +4,7 @@
community.vmware.vmware_guest_info:
name: "{{ (item | basename | split('.'))[:-1] | join('.') }}"
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
- name: Parse OVA files for network mappings
@ -17,7 +17,7 @@
GOVC_PASSWORD: "{{ vapp['hv.password'] }}"
register: ova_spec
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:
index_var: index
@ -32,10 +32,15 @@
ovf: "{{ item }}"
register: ova_deploy
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:
index_var: index
- debug:
msg: "{{ existing_ova.results | first }}"
- debug:
msg: "{{ ova_deploy.results | first }}"
- name: Add additional placeholder disk
community.vmware.vmware_guest_disk:
name: "{{ item.instance.hw_name }}"

View File

@ -28,6 +28,10 @@
ansible.builtin.set_fact:
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
ansible.posix.mount:
path: /mnt/blockstorage

View File

@ -4,7 +4,7 @@
community.vmware.vmware_guest_info:
name: "{{ (item | basename | split('.'))[:-1] | join('.') }}"
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
- name: Parse OVA files for network mappings
@ -17,7 +17,7 @@
GOVC_PASSWORD: "{{ vapp['hv.password'] }}"
register: ova_spec
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:
index_var: index
@ -33,7 +33,7 @@
ovf: "{{ item }}"
register: ova_deploy
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:
index_var: index

View File

@ -3,11 +3,11 @@ platform:
k3s:
version: v1.26.2+k3s1
gitops:
repository:
uri: https://code.spamasaurus.com/djpbessems/GitOps.MetaCluster.git
# revision: v0.1.0
revision: HEAD
# gitops:
# repository:
# uri: https://code.spamasaurus.com/djpbessems/GitOps.MetaCluster.git
# # revision: v0.1.0
# revision: HEAD
packaged_components:
- name: traefik
@ -216,7 +216,7 @@ components:
longhorn:
helm:
version: 1.4.0
version: 1.4.1
chart: longhorn/longhorn
parse_logic: cat values.yaml | yq eval '.. | select(has("repository")) | .repository + ":" + .tag'
chart_values: !unsafe |

View 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