Skip to content

Commit 1c0f94f

Browse files
authored
Merge pull request #53 from stackhpc/centos8
Support CentOS 8
2 parents a9f2883 + 016d4b1 commit 1c0f94f

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

tasks/autodetect.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,21 @@
4747
when: item.stat.exists
4848
when: libvirt_vm_engine == 'kvm'
4949

50+
- block:
51+
- name: Detect the QEMU emulator binary path
52+
stat:
53+
path: /usr/libexec/qemu-kvm
54+
register: kvm_emulator_result
55+
56+
- name: Set a fact containing the QEMU emulator binary path
57+
set_fact:
58+
libvirt_vm_emulator: "{{ kvm_emulator_result.stat.path }}"
59+
when: kvm_emulator_result.stat.exists
60+
when:
61+
- libvirt_vm_engine == 'qemu'
62+
- ansible_os_family == 'RedHat'
63+
- ansible_distribution_major_version | int >= 8
64+
5065
- block:
5166
- name: Detect the QEMU emulator binary path
5267
shell: which qemu-system-{{ libvirt_vm_arch }}
@@ -56,7 +71,10 @@
5671
- name: Set a fact containing the QEMU emulator binary path
5772
set_fact:
5873
libvirt_vm_emulator: "{{ qemu_emulator_result.stdout }}"
59-
when: libvirt_vm_engine == 'qemu'
74+
75+
when:
76+
- libvirt_vm_engine == 'qemu'
77+
- ansible_os_family != 'RedHat' or ansible_distribution_major_version | int == 7
6078

6179
- name: Fail if unable to detect the emulator
6280
fail:

tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
console_log_path: >-
3030
{{ vm.console_log_path |
3131
default(libvirt_vm_default_console_log_dir + '/' + vm.name + '-console.log', true) }}
32-
machine_default: "{{ none if libvirt_vm_engine == 'kvm' else 'pc-1.0' }}"
32+
machine_default: "{{ none if libvirt_vm_engine == 'kvm' else 'pc' }}"
3333
machine: "{{ vm.machine | default(machine_default, true) }}"
3434
cpu_mode: "{{ vm.cpu_mode | default(libvirt_cpu_mode_default) }}"
3535
volumes: "{{ vm.volumes | default([], true) }}"

0 commit comments

Comments
 (0)