Browse Source

Generate timestamped etcd backups.

Devan Goodwin 9 years ago
parent
commit
561c347d54
1 changed files with 2 additions and 2 deletions
  1. 2 2
      playbooks/adhoc/upgrades/upgrade.yml

+ 2 - 2
playbooks/adhoc/upgrades/upgrade.yml

@@ -11,10 +11,10 @@
   hosts: masters
   hosts: masters
   vars:
   vars:
     embedded_etcd: "{{ openshift.master.embedded_etcd }}"
     embedded_etcd: "{{ openshift.master.embedded_etcd }}"
+    timestamp: "{{ lookup('pipe', 'date +%Y%m%d%H%M%S') }}"
   roles:
   roles:
   - openshift_facts
   - openshift_facts
   tasks:
   tasks:
-  - debug: var=etcd_data_dir
   - name: Check available disk space for etcd backup
   - name: Check available disk space for etcd backup
     # We assume to be using the data dir for all backups.
     # We assume to be using the data dir for all backups.
     shell: >
     shell: >
@@ -33,7 +33,7 @@
   - name: Install etcd (for etcdctl)
   - name: Install etcd (for etcdctl)
     yum: pkg=etcd state=latest
     yum: pkg=etcd state=latest
   - name: Generate etcd backup
   - name: Generate etcd backup
-    command: etcdctl backup
+    command: etcdctl backup --data-dir={{ openshift.master.etcd_data_dir }} --backup-dir={{ openshift.common.data_dir }}/etcd-backup-{{ timestamp }}
   - fail: msg="All done for now."
   - fail: msg="All done for now."
 
 
 - name: Re-Run cluster configuration to apply latest configuration changes
 - name: Re-Run cluster configuration to apply latest configuration changes