refactor(vars): remove legacy variable inputs
This commit is contained in:
@@ -82,7 +82,7 @@
|
||||
when: install_type == "virtual"
|
||||
block:
|
||||
- name: Check if VM already exists on libvirt
|
||||
when: hypervisor == "libvirt"
|
||||
when: hypervisor_type == "libvirt"
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
community.libvirt.virt:
|
||||
@@ -92,7 +92,7 @@
|
||||
failed_when: false
|
||||
|
||||
- name: Abort if VM already exists on libvirt
|
||||
when: hypervisor == "libvirt"
|
||||
when: hypervisor_type == "libvirt"
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- hostname not in system_check_libvirt_existing_vms.domains | default([])
|
||||
@@ -103,14 +103,14 @@
|
||||
quiet: true
|
||||
|
||||
- name: Check if VM already exists on Proxmox
|
||||
when: hypervisor == "proxmox"
|
||||
when: hypervisor_type == "proxmox"
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
community.proxmox.proxmox_vm_info:
|
||||
api_host: "{{ hypervisor_url }}"
|
||||
api_user: "{{ hypervisor_username }}"
|
||||
api_password: "{{ hypervisor_password }}"
|
||||
node: "{{ hypervisor_node }}"
|
||||
api_host: "{{ hypervisor_cfg.url }}"
|
||||
api_user: "{{ hypervisor_cfg.username }}"
|
||||
api_password: "{{ hypervisor_cfg.password }}"
|
||||
node: "{{ hypervisor_cfg.node }}"
|
||||
vmid: "{{ system_cfg.id }}"
|
||||
name: "{{ hostname }}"
|
||||
type: qemu
|
||||
@@ -118,7 +118,7 @@
|
||||
changed_when: false
|
||||
|
||||
- name: Abort if VM already exists on Proxmox
|
||||
when: hypervisor == "proxmox"
|
||||
when: hypervisor_type == "proxmox"
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- system_check_proxmox_check_result.proxmox_vms | default([]) | length == 0
|
||||
@@ -129,14 +129,14 @@
|
||||
quiet: true
|
||||
|
||||
- name: Check if VM already exists in vCenter
|
||||
when: hypervisor == "vmware"
|
||||
when: hypervisor_type == "vmware"
|
||||
delegate_to: localhost
|
||||
community.vmware.vmware_guest_info:
|
||||
hostname: "{{ hypervisor_url }}"
|
||||
username: "{{ hypervisor_username }}"
|
||||
password: "{{ hypervisor_password }}"
|
||||
validate_certs: "{{ hypervisor_validate_certs }}"
|
||||
datacenter: "{{ hypervisor_datacenter }}"
|
||||
hostname: "{{ hypervisor_cfg.url }}"
|
||||
username: "{{ hypervisor_cfg.username }}"
|
||||
password: "{{ hypervisor_cfg.password }}"
|
||||
validate_certs: "{{ hypervisor_cfg.validate_certs | bool }}"
|
||||
datacenter: "{{ hypervisor_cfg.datacenter }}"
|
||||
name: "{{ hostname }}"
|
||||
folder: "{{ system_cfg.path if system_cfg.path | length > 0 else omit }}"
|
||||
register: system_check_vmware_check_result
|
||||
@@ -144,7 +144,7 @@
|
||||
changed_when: false
|
||||
|
||||
- name: Fail if vCenter lookup failed unexpectedly
|
||||
when: hypervisor == "vmware"
|
||||
when: hypervisor_type == "vmware"
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- not system_check_vmware_check_result.failed
|
||||
@@ -155,7 +155,7 @@
|
||||
quiet: true
|
||||
|
||||
- name: Abort if VM already exists in vCenter
|
||||
when: hypervisor == "vmware"
|
||||
when: hypervisor_type == "vmware"
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- system_check_vmware_check_result.instance is not defined
|
||||
@@ -166,7 +166,7 @@
|
||||
quiet: true
|
||||
|
||||
- name: Check if VM already exists on Xen
|
||||
when: hypervisor == "xen"
|
||||
when: hypervisor_type == "xen"
|
||||
delegate_to: localhost
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
@@ -177,7 +177,7 @@
|
||||
failed_when: false
|
||||
|
||||
- name: Abort if VM already exists on Xen
|
||||
when: hypervisor == "xen"
|
||||
when: hypervisor_type == "xen"
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- hostname not in system_check_xen_existing_vms.stdout | default('')
|
||||
|
||||
Reference in New Issue
Block a user