feat: Remove node-template hypervisor upload logic (treat as prerequisite instead)
This commit is contained in:
@ -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
|
Reference in New Issue
Block a user