We need to keep using Python 2 for Ansible, because Python 3 is
only supported by the dnf module and on CentOS 7 we have to use
the yum module instead; at the same time, all libvirt projects
have now dropped Python 2 support so we need to make sure we use
Python 3 for building them.
Decouple the Python versions used for the two purposes so that
we can keep everything working.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/playbooks/update/tasks/paths.yml | 2 ++
guests/playbooks/update/templates/bashrc.j2 | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/guests/playbooks/update/tasks/paths.yml
b/guests/playbooks/update/tasks/paths.yml
index aada1f3..c204462 100644
--- a/guests/playbooks/update/tasks/paths.yml
+++ b/guests/playbooks/update/tasks/paths.yml
@@ -14,6 +14,7 @@
- make
- ninja
- ninja-build
+ - python3
- su
- name: 'Look for files'
@@ -39,6 +40,7 @@
bash: '{{ commands["bash"] }}'
ccache: '{{ commands["ccache"] }}'
java: '{{ commands["java"] }}'
+ python: '{{ commands["python3"] }}'
su: '{{ commands["su"] }}'
sudoers: '{{ files["sudoers"] }}'
diff --git a/guests/playbooks/update/templates/bashrc.j2
b/guests/playbooks/update/templates/bashrc.j2
index d3fc652..9cea90c 100644
--- a/guests/playbooks/update/templates/bashrc.j2
+++ b/guests/playbooks/update/templates/bashrc.j2
@@ -2,7 +2,7 @@ export PS1="[\u@\h \w]\$ "
export MAKE="{{ make }}"
export NINJA="{{ ninja }}"
-export PYTHON="{{ ansible_python_interpreter }}"
+export PYTHON="{{ python }}"
export MAKEFLAGS="-j{{ install_vcpus|int + 1 }}"
--
2.23.0