summaryrefslogtreecommitdiffstats
path: root/playbooks/adhoc/upgrades
diff options
context:
space:
mode:
authorDevan Goodwin <dgoodwin@redhat.com>2015-11-03 09:37:48 -0400
committerDevan Goodwin <dgoodwin@redhat.com>2015-11-03 09:37:48 -0400
commitd608d84361a073b2f6c3c0ba08558027cf237890 (patch)
tree05730b875df72c97e0810efb7cf32e38812de8ac /playbooks/adhoc/upgrades
parent078a44715b1190f4a7e0b098b0dc87446d88ac8c (diff)
parentec31736606fc280de641e8909f03416c6b74e004 (diff)
downloadopenshift-d608d84361a073b2f6c3c0ba08558027cf237890.tar.gz
openshift-d608d84361a073b2f6c3c0ba08558027cf237890.tar.bz2
openshift-d608d84361a073b2f6c3c0ba08558027cf237890.tar.xz
openshift-d608d84361a073b2f6c3c0ba08558027cf237890.zip
Merge branch 'upgrade' into config-upgrade
Diffstat (limited to 'playbooks/adhoc/upgrades')
-rw-r--r--playbooks/adhoc/upgrades/upgrade.yml43
1 files changed, 43 insertions, 0 deletions
diff --git a/playbooks/adhoc/upgrades/upgrade.yml b/playbooks/adhoc/upgrades/upgrade.yml
index ae1d0127c..e55f1536f 100644
--- a/playbooks/adhoc/upgrades/upgrade.yml
+++ b/playbooks/adhoc/upgrades/upgrade.yml
@@ -1,4 +1,45 @@
---
+- name: Verify upgrade can proceed
+ hosts: masters
+ tasks:
+ # Checking the global deployment type rather than host facts, this is about
+ # what the user is requesting.
+ - fail: msg="Deployment type enterprise not supported for upgrade"
+ when: deployment_type == "enterprise"
+
+- name: Backup etcd
+ hosts: masters
+ vars:
+ embedded_etcd: "{{ openshift.master.embedded_etcd }}"
+ timestamp: "{{ lookup('pipe', 'date +%Y%m%d%H%M%S') }}"
+ roles:
+ - openshift_facts
+ tasks:
+ - stat: path=/var/lib/openshift
+ register: var_lib_openshift
+ - name: Create origin symlink if necessary
+ file: src=/var/lib/openshift/ dest=/var/lib/origin state=link
+ when: var_lib_openshift.stat.exists == True
+ - name: Check available disk space for etcd backup
+ # We assume to be using the data dir for all backups.
+ shell: >
+ df --output=avail -k {{ openshift.common.data_dir }} | tail -n 1
+ register: avail_disk
+
+ - name: Check current embedded etcd disk usage
+ shell: >
+ du -k {{ openshift.master.etcd_data_dir }} | tail -n 1 | cut -f1
+ register: etcd_disk_usage
+ when: embedded_etcd | bool
+
+ - name: Abort if insufficient disk space for etcd backup
+ fail: msg="{{ etcd_disk_usage.stdout }} Kb disk space required for etcd backup, {{ avail_disk.stdout }} Kb available."
+ when: (embedded_etcd | bool) and (etcd_disk_usage.stdout|int > avail_disk.stdout|int)
+ - name: Install etcd (for etcdctl)
+ yum: pkg=etcd state=latest
+ - name: Generate etcd backup
+ command: etcdctl backup --data-dir={{ openshift.master.etcd_data_dir }} --backup-dir={{ openshift.common.data_dir }}/etcd-backup-{{ timestamp }}
+
- name: Upgrade base package on masters
hosts: masters
roles:
@@ -23,6 +64,8 @@
vars:
openshift_version: "{{ openshift_pkg_version | default('') }}"
tasks:
+ - name: Upgrade to latest available kernel
+ yum: pkg=kernel state=latest
- name: Upgrade master packages
yum: pkg={{ openshift.common.service_type }}-master{{ openshift_version }} state=latest
- name: Restart master services