ansible-test/roles/virt_vm/tasks/main.yml
2021-06-06 21:46:18 +02:00

14 lines
304 B
YAML

---
- name: check vm existance
delegate_to: "{{ virt.host }}"
stat:
path: "{{ libvirt.images }}/{{ inventory_hostname }}.qcow2"
get_checksum: false
get_attributes: false
get_mime: false
register: vmimg
- name: create vm
include_tasks: create_vm.yml
when: not vmimg.stat.exists