Skip to content

Commit 2548a8b

Browse files
authored
Merge pull request #26 from stackhpc/ansible-python
Use ansible_python to determine whether to use python3
2 parents bd200cb + 1e53055 commit 2548a8b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

defaults/main.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,4 @@ libvirt_host_uri: >-
6464
6565
# Whether the python3 version of the libvirt python bindings should be
6666
# installed. If false, the python 2 bindings will be installed.
67-
libvirt_host_python3: >-
68-
{{ (ansible_os_family == 'RedHat' and ansible_distribution_major_version|int >= 8) or
69-
ansible_python_interpreter | default('python') | basename is match('python3.*') }}
67+
libvirt_host_python3: "{{ ansible_python.version.major == 3 }}"

tasks/install.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
name: "{{ package }}"
4040
state: present
4141
with_items: "{{ libvirt_host_qemu_emulators }}"
42+
# NOTE(mgoddard): CentOS 8 does not provide separate packages per-emulator.
43+
when: ansible_os_family != "RedHat" or ansible_distribution_major_version | int == 7
4244
register: result
4345
until: result is success
4446
retries: 3

0 commit comments

Comments
 (0)