summaryrefslogtreecommitdiffstats
path: root/roles/openshift_facts/tasks
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2017-02-17 09:27:04 -0500
committerColin Walters <walters@verbum.org>2017-02-17 09:27:04 -0500
commit33eecf128912879e41ce63cf0d40bf716999b641 (patch)
tree6e6f4d75af921e917c8a352f33132121f09852d1 /roles/openshift_facts/tasks
parent43330fbd7cb90491d63e54430394a309f7a41f73 (diff)
downloadopenshift-33eecf128912879e41ce63cf0d40bf716999b641.tar.gz
openshift-33eecf128912879e41ce63cf0d40bf716999b641.tar.bz2
openshift-33eecf128912879e41ce63cf0d40bf716999b641.tar.xz
openshift-33eecf128912879e41ce63cf0d40bf716999b641.zip
facts/main: Require Python 3 for Fedora, Python 2 everywhere else
For a few reasons; among them that we currently have a dependency on `PyYAML` which on Fedora Atomic Host isn't installed for Python 2 by default. Further, many dependencies are being ported in Fedora to be Python 3. Conversely, ensure that we're using Python 2 everywhere else (which is really CentOS/RHEL), since AFAIK we don't test that path at all, and we really don't need *more* entries in the supported matrix.
Diffstat (limited to 'roles/openshift_facts/tasks')
-rw-r--r--roles/openshift_facts/tasks/main.yml12
1 files changed, 12 insertions, 0 deletions
diff --git a/roles/openshift_facts/tasks/main.yml b/roles/openshift_facts/tasks/main.yml
index 9a1982076..0ec294bbc 100644
--- a/roles/openshift_facts/tasks/main.yml
+++ b/roles/openshift_facts/tasks/main.yml
@@ -14,6 +14,18 @@
l_is_master_system_container: "{{ (use_master_system_container | default(use_system_containers) | bool) }}"
l_is_etcd_system_container: "{{ (use_etcd_system_container | default(use_system_containers) | bool) }}"
+- name: Validate python version
+ fail:
+ msg: |
+ openshift-ansible requires Python 3 for {{ ansible_distribution }};
+ For information on enabling Python 3 with Ansible, see https://docs.ansible.com/ansible/python_3_support.html
+ when: ansible_distribution == 'Fedora' and ansible_python['version']['major'] != 3
+
+- name: Validate python version
+ fail:
+ msg: "openshift-ansible requires Python 2 for {{ ansible_distribution }}"
+ when: ansible_distribution != 'Fedora' and ansible_python['version']['major'] != 2
+
- name: Ensure various deps are installed
package: name={{ item }} state=present
with_items: "{{ required_packages }}"