summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevan Goodwin <dgoodwin@redhat.com>2016-06-24 10:59:11 -0300
committerDevan Goodwin <dgoodwin@redhat.com>2016-06-24 10:59:11 -0300
commitfb2f9f9d2be747a631e9ab13cb7c7898987d509d (patch)
tree486aeddb5e2ace48d46f13e57a254ea92cf784f3
parent82f4e4eaeaaf3059013e9ea23d87dcf89fd8455e (diff)
downloadopenshift-fb2f9f9d2be747a631e9ab13cb7c7898987d509d.tar.gz
openshift-fb2f9f9d2be747a631e9ab13cb7c7898987d509d.tar.bz2
openshift-fb2f9f9d2be747a631e9ab13cb7c7898987d509d.tar.xz
openshift-fb2f9f9d2be747a631e9ab13cb7c7898987d509d.zip
Allow skipping Docker upgrade during OpenShift upgrade.
-rw-r--r--inventory/byo/hosts.aep.example7
-rw-r--r--inventory/byo/hosts.origin.example7
-rw-r--r--inventory/byo/hosts.ose.example7
-rw-r--r--playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml13
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/upgrade.yml3
5 files changed, 37 insertions, 0 deletions
diff --git a/inventory/byo/hosts.aep.example b/inventory/byo/hosts.aep.example
index ffed3c042..0f7998008 100644
--- a/inventory/byo/hosts.aep.example
+++ b/inventory/byo/hosts.aep.example
@@ -92,6 +92,13 @@ openshift_release=v3.2
# Default value: "--log-driver=json-file --log-opt max-size=50m"
#openshift_docker_options="-l warn --ipv6=false"
+# Specify exact version of Docker to configure or upgrade to.
+# Downgrades are not supported and will error out. Be careful when upgrading docker from < 1.10 to > 1.10.
+# docker_version="1.10.3"
+
+# Skip upgrading Docker during an OpenShift upgrade, leaves the current Docker version alone.
+# docker_upgrade=False
+
# Alternate image format string. If you're not modifying the format string and
# only need to inject your own registry you may want to consider
# openshift_docker_additional_registries instead
diff --git a/inventory/byo/hosts.origin.example b/inventory/byo/hosts.origin.example
index d3d1e3994..27dd5a575 100644
--- a/inventory/byo/hosts.origin.example
+++ b/inventory/byo/hosts.origin.example
@@ -93,6 +93,13 @@ openshift_release=v1.2
# Default value: "--log-driver=json-file --log-opt max-size=50m"
#openshift_docker_options="-l warn --ipv6=false"
+# Specify exact version of Docker to configure or upgrade to.
+# Downgrades are not supported and will error out. Be careful when upgrading docker from < 1.10 to > 1.10.
+# docker_version="1.10.3"
+
+# Skip upgrading Docker during an OpenShift upgrade, leaves the current Docker version alone.
+# docker_upgrade=False
+
# Alternate image format string. If you're not modifying the format string and
# only need to inject your own registry you may want to consider
# openshift_docker_additional_registries instead
diff --git a/inventory/byo/hosts.ose.example b/inventory/byo/hosts.ose.example
index 2514fcc96..1831b0bae 100644
--- a/inventory/byo/hosts.ose.example
+++ b/inventory/byo/hosts.ose.example
@@ -92,6 +92,13 @@ openshift_release=v3.2
# Default value: "--log-driver=json-file --log-opt max-size=50m"
#openshift_docker_options="-l warn --ipv6=false"
+# Specify exact version of Docker to configure or upgrade to.
+# Downgrades are not supported and will error out. Be careful when upgrading docker from < 1.10 to > 1.10.
+# docker_version="1.10.3"
+
+# Skip upgrading Docker during an OpenShift upgrade, leaves the current Docker version alone.
+# docker_upgrade=False
+
# Alternate image format string. If you're not modifying the format string and
# only need to inject your own registry you may want to consider
# openshift_docker_additional_registries instead
diff --git a/playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml b/playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml
index 928913ef3..caf8d1de5 100644
--- a/playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml
+++ b/playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml
@@ -1,4 +1,10 @@
---
+
+# This snippet determines if docker_upgrade should be set for the host. If it's already
+# set via the inventory we will respect it. Otherwise we check if the current version
+# is equal to the either the latest, or the requested docker_version, and set
+# docker_upgrade accordingly.
+
- name: Determine available Docker version
script: ../../../../common/openshift-cluster/upgrades/files/rpm_versions.sh docker
register: g_docker_version_result
@@ -26,6 +32,13 @@
# Disable the 1.10 requirement if the user set a specific Docker version
when: avail_docker_version.stdout | version_compare('1.10','<') and docker_version is not defined
+# We respect docker_upgrade=False in the inventory, but True is the default and
+# if set in inventory, we still flip it to False here and only set to true if
+# they're not already running the required version.
+- set_fact:
+ docker_upgrade: False
+ when: docker_upgrade is not defined or docker_upgrade | bool
+
- name: Flag for upgrade if Docker version does not equal latest
set_fact:
docker_upgrade: true
diff --git a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/upgrade.yml b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/upgrade.yml
index 8eeb652a7..f2e408ad4 100644
--- a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/upgrade.yml
+++ b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/upgrade.yml
@@ -80,7 +80,10 @@
delegate_to: "{{ groups.oo_first_master.0 }}"
when: inventory_hostname in groups.oo_nodes_to_config
+ # Only check if docker upgrade is required if docker_upgrade is not
+ # already set to False.
- include: ../docker/upgrade_check.yml
+ when: docker_upgrade is not defined or docker_upgrade | bool
- include: ../docker/upgrade.yml
when: docker_upgrade is defined and docker_upgrade | bool