summaryrefslogtreecommitdiffstats
path: root/roles/openshift_docker/tasks
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2016-04-13 10:36:58 -0400
committerBrenton Leanhardt <bleanhar@redhat.com>2016-04-14 14:39:26 -0400
commitc298560ff539d23f60a83876feba83c970283ce7 (patch)
treed723e6ea32ad9410d50163049242b3dc5e183c05 /roles/openshift_docker/tasks
parentee3f0205333840e18c4796e53b0f061fec666333 (diff)
downloadopenshift-c298560ff539d23f60a83876feba83c970283ce7.tar.gz
openshift-c298560ff539d23f60a83876feba83c970283ce7.tar.bz2
openshift-c298560ff539d23f60a83876feba83c970283ce7.tar.xz
openshift-c298560ff539d23f60a83876feba83c970283ce7.zip
The openshift_docker role must set the version facts for containerized installs
QE found that for fresh installs we were basing the docker version facts of the images that could be pulled prior to configuring /etc/sysconfig/docker. This is an edge case but something we need to fix.
Diffstat (limited to 'roles/openshift_docker/tasks')
-rw-r--r--roles/openshift_docker/tasks/main.yml28
1 files changed, 28 insertions, 0 deletions
diff --git a/roles/openshift_docker/tasks/main.yml b/roles/openshift_docker/tasks/main.yml
new file mode 100644
index 000000000..e5135520f
--- /dev/null
+++ b/roles/openshift_docker/tasks/main.yml
@@ -0,0 +1,28 @@
+---
+# It's important that we don't explicitly pull this image here. Otherwise we
+# could result in upgrading a preinstalled environment. We'll have to set
+# openshift_image_tag correctly for upgrades.
+- name: Set version when containerized
+ command: >
+ docker run --rm {{ openshift.common.cli_image }}:latest version
+ register: cli_image_version
+ when: openshift.common.is_containerized | bool and openshift_image_tag is not defined
+
+- set_fact:
+ l_image_tag: "{{ cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0] }}"
+ when: openshift.common.is_containerized | bool and openshift_image_tag is not defined
+
+- set_fact:
+ l_image_tag: "{{ openshift_image_tag }}"
+ when: openshift.common.is_containerized | bool and openshift_image_tag is defined
+
+- name: Set post docker install facts
+ openshift_facts:
+ role: "{{ item.role }}"
+ local_facts: "{{ item.local_facts }}"
+ with_items:
+ - role: docker
+ local_facts:
+ openshift_image_tag: "{{ l_image_tag }}"
+ openshift_version: "{{ l_image_tag if l_image_tag is defined else '' | oo_image_tag_to_rpm_version }}"
+ when: openshift.common.is_containerized | bool