20 lines
442 B
YAML
20 lines
442 B
YAML
---
|
|
- include_vars: vm_templates.yml
|
|
|
|
- name: check vm existance
|
|
delegate_to: "{{ virt.host }}"
|
|
stat:
|
|
path: "{{ libvirt.images }}/{{ inventory_hostname }}.qcow2"
|
|
get_checksum: false
|
|
get_attributes: false
|
|
get_mime: false
|
|
vars:
|
|
virt: "{{ vm_templates[vm_template] }}"
|
|
register: vmimg
|
|
|
|
- name: create vm
|
|
include_tasks: create_vm.yml
|
|
vars:
|
|
virt: "{{ vm_templates[vm_template] }}"
|
|
when: not vmimg.stat.exists
|