22 lines
622 B
YAML
22 lines
622 B
YAML
---
|
|
- name: Provision Proxmox VM or LXC
|
|
hosts: localhost
|
|
gather_facts: false
|
|
vars:
|
|
proxmox_api_host: "192.168.0.166"
|
|
|
|
tasks:
|
|
- name: Include VM provisioning role
|
|
ansible.builtin.include_role:
|
|
name: proxmox_vm
|
|
when: provision_type | lower == 'vm'
|
|
|
|
- name: Include LXC provisioning role
|
|
ansible.builtin.include_role:
|
|
name: proxmox_lxc
|
|
when: provision_type | lower == 'lxc'
|
|
|
|
- name: Display created resource info
|
|
ansible.builtin.debug:
|
|
msg: "Created {{ provision_type }} '{{ vm_hostname }}' with VMID {{ created_vmid }} on node {{ target_node }}"
|