feat: Remove node-template hypervisor upload logic (treat as prerequisite instead)
Some checks failed
Container & Helm chart / Linting (push) Successful in 6s
Container & Helm chart / Semantic Release (Dry-run) (push) Successful in 50s
Container & Helm chart / Kubernetes Bootstrap Appliance (push) Failing after 6m31s

This commit is contained in:
2024-06-11 11:25:35 +10:00
parent 544f98a8fb
commit 594e62cf71
7 changed files with 84 additions and 156 deletions

View File

@ -0,0 +1,33 @@
- block:
- name: Check for existing template
community.vmware.vmware_guest_info:
name: "{{ vapp['workloadcluster.nodetemplate'] }}"
hostname: "{{ vapp['hv.fqdn'] }}"
validate_certs: false
username: "{{ vapp['hv.username'] }}"
password: "{{ vapp['hv.password'] }}"
datacenter: "{{ vcenter_info.datacenter }}"
folder: "{{ vcenter_info.folder }}"
register: nodetemplate
until:
- nodetemplate is not failed
retries: 600
delay: 30
#wait for 5 hr.
vars:
color_reset: "\e[0m"
ansible_callback_diy_runner_retry_msg: >-
{%- set result = ansible_callback_diy.result.output -%}
{%- set retries_left = result.retries - result.attempts -%}
TEMPLATE '{{ vapp['workloadcluster.nodetemplate'] }}' NOT FOUND; PLEASE UPLOAD MANUALLY -- ({{ retries_left }} retries left)
ansible_callback_diy_runner_retry_msg_color: bright yellow
- name: Store inventory path of existing template
ansible.builtin.set_fact:
nodetemplate_inventorypath: "{{ nodetemplate.instance.hw_folder ~ '/' ~ nodetemplate.instance.hw_name }}"
rescue:
- name: CRITICAL ERROR
ansible.builtin.fail:
msg: Required node-template is not available; cannot continue