Issue-ID: INF-441
Change-Id: I7da6fd4fff3464605145acdf9c1114ef2242bcfe
Signed-off-by: Chris Wheeler <chwheele@redhat.com>
run_once: true
become: true
run_once: true
become: true
+- name: Locate qemu-kvm emulator
+ stat:
+ path: "{{ item }}"
+ register: ocloud_infra_vm_emulator_stat
+ loop:
+ - /usr/bin/qemu-kvm
+ - /usr/libexec/qemu-kvm
+
+- set_fact:
+ ocloud_infra_vm_emulator_path: "{{ item.stat.path }}"
+ when: item.stat.exists
+ loop: "{{ ocloud_infra_vm_emulator_stat.results }}"
+
- name: Create virtual machine - {{ inventory_hostname }}
community.libvirt.virt:
command: define
- name: Create virtual machine - {{ inventory_hostname }}
community.libvirt.virt:
command: define
<suspend-to-disk enabled='no'/>
</pm>
<devices>
<suspend-to-disk enabled='no'/>
</pm>
<devices>
- <emulator>/usr/libexec/qemu-kvm</emulator>
+ <emulator>{{ ocloud_infra_vm_emulator_path }}</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='{{ ocloud_infra_vm_disk_path }}'/>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='{{ ocloud_infra_vm_disk_path }}'/>