besseres templating für VMs
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
- name: create vm storage
|
||||
delegate_to: "{{ virt.host }}"
|
||||
copy:
|
||||
src: "{{ libvirt.images }}/{{ virt.image }}"
|
||||
src: "{{ libvirt.images }}/{{ virt.image.filename }}"
|
||||
dest: "{{ libvirt.images }}/{{ inventory_hostname }}.qcow2"
|
||||
force: no
|
||||
|
||||
|
@@ -1,4 +1,6 @@
|
||||
---
|
||||
- include_vars: vm_templates.yml
|
||||
|
||||
- name: check vm existance
|
||||
delegate_to: "{{ virt.host }}"
|
||||
stat:
|
||||
@@ -6,8 +8,12 @@
|
||||
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
|
||||
|
Reference in New Issue
Block a user