Files
homelab/infra-config/playbooks/proxmox_start_vm.yml

33 lines
906 B
YAML

---
- name: Create VM ID from IP address for Proxmox hosts
hosts: all
gather_facts: false
tasks:
- name: Start Proxmox VM
delegate_to: "localhost"
when: platform is defined and platform == "proxmox"
community.proxmox.proxmox_kvm:
api_user: "{{ proxmox_user }}"
api_password: "{{ proxmox_password }}"
api_host: "{{ proxmox_host }}"
name: "{{ inventory_hostname }}"
node: "{{ proxmox_clone_node }}"
state: started
# - name: Wait for the VM to start
# delegate_to: "localhost"
# wait_for:
# port: 22
# host: "{{ inventory_hostname }}"
# search_regex: OpenSSH
# delay: 10
# timeout: 60
# - name: Wait for the reboot to complete if there was a change.
# wait_for_connection:
# connect_timeout: 10
# sleep: 5
# delay: 5
# timeout: 300