From 3d7c5c6fd545112d87fa09e4a8c3f3cbc1cda1ee Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Wed, 28 Oct 2015 15:29:52 -0300 Subject: First cut at checking available disk space for etcd backup. --- playbooks/adhoc/upgrades/upgrade.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'playbooks') diff --git a/playbooks/adhoc/upgrades/upgrade.yml b/playbooks/adhoc/upgrades/upgrade.yml index e8d6a335d..c2c1d57e8 100644 --- a/playbooks/adhoc/upgrades/upgrade.yml +++ b/playbooks/adhoc/upgrades/upgrade.yml @@ -1,5 +1,5 @@ --- -- name: Verify deployment type +- name: Verify upgrade can proceed hosts: masters tasks: # Checking the global deployment type rather than host facts, this is about @@ -7,6 +7,31 @@ - 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 }}" + roles: + - openshift_facts + tasks: + - name: display all variables set for the current host + debug: + var: hostvars[inventory_hostname] + - debug: var=embedded_etcd + - name: Check available data dir disk space + shell: > + df --output=avail -k {{ openshift.common.data_dir }} | tail -n 1 + register: avail_disk + when: embedded_etcd | bool + - debug: var=avail_disk.stdout + - name: Check current etcd disk usage + shell: > + df --output=avail -k /var/lib/openshift/openshift.local.etcd/ | tail -n 1 + register: etc_disk_usage + when: embedded_etcd | bool + - debug: var=etc_disk_usage.stdout + - fail: msg="All done for now." + - name: Re-Run cluster configuration to apply latest configuration changes include: ../../common/openshift-cluster/config.yml vars: -- cgit v1.2.3