diff options
author | Scott Dodson <sdodson@redhat.com> | 2016-11-09 13:16:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-09 13:16:43 -0500 |
commit | 24804da994917f50be32e2c5fb62e2e120e6652f (patch) | |
tree | 22d186b2b3be7f2305745588036e2dee6f1721d6 /playbooks | |
parent | bf0f8266e91b552ffa815d3a7bcb65f105606438 (diff) | |
parent | 6396343e2bc8559e5738e663b15a2c21bde37547 (diff) | |
download | openshift-24804da994917f50be32e2c5fb62e2e120e6652f.tar.gz openshift-24804da994917f50be32e2c5fb62e2e120e6652f.tar.bz2 openshift-24804da994917f50be32e2c5fb62e2e120e6652f.tar.xz openshift-24804da994917f50be32e2c5fb62e2e120e6652f.zip |
Merge pull request #2730 from dgoodwin/fix-ha-etcd-backup
Fix HA etcd upgrade when facts cache has been deleted.
Diffstat (limited to 'playbooks')
-rw-r--r-- | playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml index 927d9b4ca..afbfe0106 100644 --- a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml +++ b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml @@ -13,10 +13,23 @@ groups: etcd_hosts_to_backup with_items: "{{ groups.oo_etcd_to_config if groups.oo_etcd_to_config is defined and groups.oo_etcd_to_config | length > 0 else groups.oo_first_master }}" +# If facts cache were for some reason deleted, this fact may not be set, and if not set +# it will always default to true. This causes problems for the etcd data dir fact detection +# so we must first make sure this is set correctly before attempting the backup. +- name: Set master embedded_etcd fact + hosts: oo_masters_to_config + roles: + - openshift_facts + tasks: + - openshift_facts: + role: master + local_facts: + embedded_etcd: "{{ groups.oo_etcd_to_config | length == 0 }}" + - name: Backup etcd hosts: etcd_hosts_to_backup vars: - embedded_etcd: "{{ hostvars[groups.oo_first_master.0].openshift.master.embedded_etcd }}" + embedded_etcd: "{{ groups.oo_etcd_to_config | default([]) | length == 0 }}" timestamp: "{{ lookup('pipe', 'date +%Y%m%d%H%M%S') }}" roles: - openshift_facts |