- Remove unused sudo_lecture.txt.j2 template (never referenced) - Add vars_proxmox.yml and .sisyphus/ to .gitignore - Remove redundant inner when conditions in cleanup/vmware.yml - Standardize bootstrap_var_key usage in alpine, opensuse, void tasks - Normalize sysctl key=value formatting (remove inconsistent spaces) - Add vars_baremetal_example.yml to README examples list - Remove unnecessary changed_when on set_fact in hypervisor.yml Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39 lines
1.3 KiB
YAML
39 lines
1.3 KiB
YAML
---
|
|
- name: Clean vCenter VM
|
|
when: hypervisor_type == "vmware"
|
|
delegate_to: localhost
|
|
become: false
|
|
block:
|
|
- name: Remove CD-ROM from VM in vCenter
|
|
community.vmware.vmware_guest:
|
|
hostname: "{{ hypervisor_cfg.url }}"
|
|
username: "{{ hypervisor_cfg.username }}"
|
|
password: "{{ hypervisor_cfg.password }}"
|
|
validate_certs: "{{ hypervisor_cfg.certs | bool }}"
|
|
datacenter: "{{ hypervisor_cfg.datacenter }}"
|
|
name: "{{ hostname }}"
|
|
cdrom:
|
|
- controller_number: 0
|
|
unit_number: 0
|
|
controller_type: sata
|
|
type: iso
|
|
iso_path: "{{ boot_iso }}"
|
|
state: absent
|
|
- controller_number: 0
|
|
unit_number: 1
|
|
controller_type: sata
|
|
type: iso
|
|
iso_path: "{{ rhel_iso if rhel_iso is defined and rhel_iso | length > 0 else omit }}"
|
|
state: absent
|
|
failed_when: false
|
|
|
|
- name: Start VM in vCenter
|
|
vmware.vmware.vm_powerstate:
|
|
hostname: "{{ hypervisor_cfg.url }}"
|
|
username: "{{ hypervisor_cfg.username }}"
|
|
password: "{{ hypervisor_cfg.password }}"
|
|
validate_certs: "{{ hypervisor_cfg.certs | bool }}"
|
|
datacenter: "{{ hypervisor_cfg.datacenter }}"
|
|
name: "{{ hostname }}"
|
|
state: powered-on
|