summaryrefslogtreecommitdiffstats
path: root/roles/openshift_docker
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2016-04-15 10:24:59 -0400
committerBrenton Leanhardt <bleanhar@redhat.com>2016-04-15 10:24:59 -0400
commitdbb94c4e5461780adb74e864e6b0919153b5ffe7 (patch)
treea2be6d3e8f107bfea0d016d900dbd262cce98baa /roles/openshift_docker
parenta9893ab91495a7b5530648191291bcb9de9cd291 (diff)
parent2342cb2f47050d430ff7fb07e68e9e42006884eb (diff)
downloadopenshift-dbb94c4e5461780adb74e864e6b0919153b5ffe7.tar.gz
openshift-dbb94c4e5461780adb74e864e6b0919153b5ffe7.tar.bz2
openshift-dbb94c4e5461780adb74e864e6b0919153b5ffe7.tar.xz
openshift-dbb94c4e5461780adb74e864e6b0919153b5ffe7.zip
Merge pull request #1746 from brenton/docker1
The openshift_docker role must set the version facts for containerize…
Diffstat (limited to 'roles/openshift_docker')
-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..23613b762
--- /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 is defined and 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 is defined and 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 is defined and 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 is defined and openshift.common.is_containerized | bool