summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2017-09-11 14:08:27 -0400
committerGitHub <noreply@github.com>2017-09-11 14:08:27 -0400
commitf95e3c4133e8d8e4878b1e37398c5b2288f81905 (patch)
tree350f0c199072b7e5fb3bb836b18ac4976de402b2
parente33eefbcb2b04ea2a985b253bddf13539fbf6eea (diff)
parent10ecef48e62ae6338ce10417dd153c0a388eb2cf (diff)
downloadopenshift-f95e3c4133e8d8e4878b1e37398c5b2288f81905.tar.gz
openshift-f95e3c4133e8d8e4878b1e37398c5b2288f81905.tar.bz2
openshift-f95e3c4133e8d8e4878b1e37398c5b2288f81905.tar.xz
openshift-f95e3c4133e8d8e4878b1e37398c5b2288f81905.zip
Merge pull request #5256 from ashcrow/1451023
upgrade: Verify required network items are set
-rw-r--r--inventory/byo/hosts.origin.example2
-rw-r--r--inventory/byo/hosts.ose.example2
-rw-r--r--playbooks/common/openshift-cluster/upgrades/pre/verify_inventory_vars.yml15
3 files changed, 19 insertions, 0 deletions
diff --git a/inventory/byo/hosts.origin.example b/inventory/byo/hosts.origin.example
index df0491d71..c32c47fe1 100644
--- a/inventory/byo/hosts.origin.example
+++ b/inventory/byo/hosts.origin.example
@@ -613,6 +613,7 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
# WORKAROUND : If you must use an overlapping subnet, you can configure a non conflicting
# docker0 CIDR range by adding '--bip=192.168.2.1/24' to DOCKER_NETWORK_OPTIONS
# environment variable located in /etc/sysconfig/docker-network.
+# When upgrading these must be specificed!
#osm_cluster_network_cidr=10.128.0.0/14
#openshift_portal_net=172.30.0.0/16
@@ -634,6 +635,7 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
# Configure number of bits to allocate to each host’s subnet e.g. 9
# would mean a /23 network on the host.
+# When upgrading this must be specificed!
#osm_host_subnet_length=9
# Configure master API and console ports.
diff --git a/inventory/byo/hosts.ose.example b/inventory/byo/hosts.ose.example
index 79eb59ab9..e867ffbae 100644
--- a/inventory/byo/hosts.ose.example
+++ b/inventory/byo/hosts.ose.example
@@ -621,6 +621,7 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
# WORKAROUND : If you must use an overlapping subnet, you can configure a non conflicting
# docker0 CIDR range by adding '--bip=192.168.2.1/24' to DOCKER_NETWORK_OPTIONS
# environment variable located in /etc/sysconfig/docker-network.
+# When upgrading these must be specificed!
#osm_cluster_network_cidr=10.128.0.0/14
#openshift_portal_net=172.30.0.0/16
@@ -642,6 +643,7 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
# Configure number of bits to allocate to each host’s subnet e.g. 9
# would mean a /23 network on the host.
+# When upgrading this must be specificed!
#osm_host_subnet_length=9
# Configure master API and console ports.
diff --git a/playbooks/common/openshift-cluster/upgrades/pre/verify_inventory_vars.yml b/playbooks/common/openshift-cluster/upgrades/pre/verify_inventory_vars.yml
index 9a959a959..78923e04f 100644
--- a/playbooks/common/openshift-cluster/upgrades/pre/verify_inventory_vars.yml
+++ b/playbooks/common/openshift-cluster/upgrades/pre/verify_inventory_vars.yml
@@ -9,6 +9,21 @@
deployment types
when: deployment_type not in ['origin','openshift-enterprise', 'online']
+ # osm_cluster_network_cidr, osm_host_subnet_length and openshift_portal_net are
+ # required when upgrading to avoid changes that may occur between releases
+ # Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1451023
+ - assert:
+ that:
+ - "osm_cluster_network_cidr is defined"
+ - "osm_host_subnet_length is defined"
+ - "openshift_portal_net is defined"
+ msg: >
+ osm_cluster_network_cidr, osm_host_subnet_length, and openshift_portal_net are required inventory
+ variables when upgrading. These variables should match what is currently used in the cluster. If
+ you don't remember what these values are you can find them in /etc/origin/master/master-config.yaml
+ on a master with the names clusterNetworkCIDR (osm_cluster_network_cidr),
+ osm_host_subnet_length (hostSubnetLength), and openshift_portal_net (hostSubnetLength).
+
# Error out in situations where the user has older versions specified in their
# inventory in any of the openshift_release, openshift_image_tag, and
# openshift_pkg_version variables. These must be removed or updated to proceed