summaryrefslogtreecommitdiffstats
path: root/playbooks/common/openshift-cluster
diff options
context:
space:
mode:
authorJan Chaloupka <jchaloup@redhat.com>2017-09-25 13:23:17 +0200
committerJan Chaloupka <jchaloup@redhat.com>2017-09-25 15:35:05 +0200
commitf2669d64113bcdc0c16f7205cbaf42a062f596a9 (patch)
treeddb3e755534d6b99cafcf19f6fb2a69dbc6ccdb1 /playbooks/common/openshift-cluster
parent4c46c0748b06a088d2dd5bb0af439e55718271f5 (diff)
downloadopenshift-f2669d64113bcdc0c16f7205cbaf42a062f596a9.tar.gz
openshift-f2669d64113bcdc0c16f7205cbaf42a062f596a9.tar.bz2
openshift-f2669d64113bcdc0c16f7205cbaf42a062f596a9.tar.xz
openshift-f2669d64113bcdc0c16f7205cbaf42a062f596a9.zip
check if the storage backend is set to etcd3 before upgrading to 3.7
Diffstat (limited to 'playbooks/common/openshift-cluster')
-rw-r--r--playbooks/common/openshift-cluster/upgrades/pre/verify_etcd3_backend.yml22
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_7/upgrade_control_plane.yml4
2 files changed, 26 insertions, 0 deletions
diff --git a/playbooks/common/openshift-cluster/upgrades/pre/verify_etcd3_backend.yml b/playbooks/common/openshift-cluster/upgrades/pre/verify_etcd3_backend.yml
new file mode 100644
index 000000000..f75ae3b15
--- /dev/null
+++ b/playbooks/common/openshift-cluster/upgrades/pre/verify_etcd3_backend.yml
@@ -0,0 +1,22 @@
+---
+- name: Verify all masters has etcd3 storage backend set
+ hosts: oo_masters_to_config
+ gather_facts: no
+ roles:
+ - lib_utils
+ tasks:
+ - name: Read master storage backend setting
+ yedit:
+ state: list
+ src: /etc/origin/master/master-config.yaml
+ key: kubernetesMasterConfig.apiServerArguments.storage-backend
+ register: _storage_backend
+
+ - fail:
+ msg: "Storage backend in /etc/origin/master/master-config.yaml must be set to 'etcd3' before the upgrade can continue"
+ when:
+ # assuming the master-config.yml is properly configured, i.e. the value is a list
+ - _storage_backend.result | default([], true) | length == 0 or _storage_backend.result[0] != "etcd3"
+
+ - debug:
+ msg: "Storage backend is set to etcd3"
diff --git a/playbooks/common/openshift-cluster/upgrades/v3_7/upgrade_control_plane.yml b/playbooks/common/openshift-cluster/upgrades/v3_7/upgrade_control_plane.yml
index 3549cf6c3..6cd3bd3e5 100644
--- a/playbooks/common/openshift-cluster/upgrades/v3_7/upgrade_control_plane.yml
+++ b/playbooks/common/openshift-cluster/upgrades/v3_7/upgrade_control_plane.yml
@@ -29,6 +29,10 @@
tags:
- pre_upgrade
+- include: ../pre/verify_etcd3_backend.yml
+ tags:
+ - pre_upgrade
+
- name: Update repos on control plane hosts
hosts: oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config
tags: