summaryrefslogtreecommitdiffstats
path: root/roles/openshift_facts/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_facts/tasks/main.yml')
-rw-r--r--roles/openshift_facts/tasks/main.yml28
1 files changed, 28 insertions, 0 deletions
diff --git a/roles/openshift_facts/tasks/main.yml b/roles/openshift_facts/tasks/main.yml
index 0ec294bbc..73c668c72 100644
--- a/roles/openshift_facts/tasks/main.yml
+++ b/roles/openshift_facts/tasks/main.yml
@@ -13,6 +13,8 @@
l_is_node_system_container: "{{ (use_node_system_container | default(use_system_containers) | bool) }}"
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) }}"
+- set_fact:
+ l_any_system_container: "{{ l_is_etcd_system_container or l_is_openvswitch_system_container or l_is_node_system_container or l_is_master_system_container }}"
- name: Validate python version
fail:
@@ -26,11 +28,37 @@
msg: "openshift-ansible requires Python 2 for {{ ansible_distribution }}"
when: ansible_distribution != 'Fedora' and ansible_python['version']['major'] != 2
+# Fail as early as possible if Atomic and old version of Docker
+- block:
+
+ # See https://access.redhat.com/articles/2317361
+ # and https://github.com/ansible/ansible/issues/15892
+ # NOTE: the "'s can not be removed at this level else the docker command will fail
+ # NOTE: When ansible >2.2.1.x is used this can be updated per
+ # https://github.com/openshift/openshift-ansible/pull/3475#discussion_r103525121
+ - name: Determine Atomic Host Docker Version
+ shell: 'CURLY="{"; docker version --format "$CURLY{json .Server.Version}}"'
+ register: l_atomic_docker_version
+
+ - assert:
+ msg: Installation on Atomic Host requires Docker 1.12 or later. Please upgrade and restart the Atomic Host.
+ that:
+ - l_atomic_docker_version.stdout | replace('"', '') | version_compare('1.12','>=')
+
+ when: l_is_atomic | bool
+
- name: Ensure various deps are installed
package: name={{ item }} state=present
with_items: "{{ required_packages }}"
when: not l_is_atomic | bool
+- name: Ensure various deps for running system containers are installed
+ package: name={{ item }} state=present
+ with_items: "{{ required_system_containers_packages }}"
+ when:
+ - not l_is_atomic | bool
+ - l_any_system_container | bool
+
- name: Gather Cluster facts and set is_containerized if needed
openshift_facts:
role: common