Almost all our target operating systems have a version
of Python 3 which is recent enough (>= 3.5) to be used
by Ansible available.
In fact, almost all of them have it pre-installed, which
makes installing Python 2 in addition to it just to use
Ansible, when Ansible itself would be absolutely happy
running on Python 3, quite silly.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/playbooks/update/tasks/bootstrap.yml | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/guests/playbooks/update/tasks/bootstrap.yml
b/guests/playbooks/update/tasks/bootstrap.yml
index d7abb86..f2b40e0 100644
--- a/guests/playbooks/update/tasks/bootstrap.yml
+++ b/guests/playbooks/update/tasks/bootstrap.yml
@@ -4,17 +4,32 @@
when:
- package_format == 'pkg'
+- set_fact:
+ python: python3
+
+- set_fact:
+ python: python2
+ when:
+ - os_name == 'CentOS'
+ - os_version == '7'
+
+- set_fact:
+ python: python
+ when:
+ - os_name == 'Debian'
+ - os_version == '8'
+
- name: Bootstrap Ansible
- raw: yum install -y python2
+ raw: 'yum install -y {{ python }}'
when:
- package_format == 'rpm'
- name: Bootstrap Ansible
- raw: apt-get install -y python
+ raw: 'apt-get install -y {{ python }}'
when:
- package_format == 'deb'
- name: Bootstrap Ansible
- raw: pkg install -y python2
+ raw: 'pkg install -y {{ python }}'
when:
- package_format == 'pkg'
--
2.19.2