summaryrefslogtreecommitdiffstats
path: root/playbooks/common/openshift-etcd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2017-09-24 11:46:04 -0700
committerGitHub <noreply@github.com>2017-09-24 11:46:04 -0700
commit02485be8fe554e03bf07f0650f9ff36398679722 (patch)
treef4394f8c81eef0d588ad70c723babdf6059a730f /playbooks/common/openshift-etcd
parent5632b266c6d44f371fe7d36a0e367c462cf7a701 (diff)
parent775128cc52d8295fe4cf08211ab53730d101692c (diff)
downloadopenshift-02485be8fe554e03bf07f0650f9ff36398679722.tar.gz
openshift-02485be8fe554e03bf07f0650f9ff36398679722.tar.bz2
openshift-02485be8fe554e03bf07f0650f9ff36398679722.tar.xz
openshift-02485be8fe554e03bf07f0650f9ff36398679722.zip
Merge pull request #5495 from abutcher/ca-redeploy-expired-etcd
Automatic merge from submit-queue Improve CA redeploy restart logic Expired etcd certificates require special casing around restarts in the certificate redeploy playbooks. When etcd certificates are expired we can't restart masters or nodes. We also can't simply restart etcd because peers also had expired certificates so we must start/stop etcd when we detect expired etcd certificates. `openshift-ca.yml`: * No longer restart master services when etcd certificates were previously expired. * No longer restart node services when master or etcd certificates were previously expired. `etcd-ca.yml`: * No longer restart master services when etcd certificates were previously expired. Tested using [gen_expired_tls.sh](https://gist.github.com/abutcher/bdd20b9d582675d89fb22658689c49e4) on one of my master/etcd hosts to ensure that restart logic changes caused us to skip the right restarts and do a full start/stop of etcd in the `redeploy-certificates.yml` and `redeploy-etcd-certificates.yml` playbooks. Note: When this happens with a cluster and you want to replace all certificates, you can run: `redeploy-etcd-ca.yml`, `redeploy-openshift-ca.yml` (which will both skip restarts) and then run `redeploy-certificates.yml` which will now be able to full/stop start etcd.
Diffstat (limited to 'playbooks/common/openshift-etcd')
-rw-r--r--playbooks/common/openshift-etcd/restart.yml18
1 files changed, 18 insertions, 0 deletions
diff --git a/playbooks/common/openshift-etcd/restart.yml b/playbooks/common/openshift-etcd/restart.yml
index af1ef245a..5eaea5ae8 100644
--- a/playbooks/common/openshift-etcd/restart.yml
+++ b/playbooks/common/openshift-etcd/restart.yml
@@ -7,3 +7,21 @@
service:
name: "{{ 'etcd_container' if openshift.common.etcd_runtime == 'docker' else 'etcd' }}"
state: restarted
+ when:
+ - not g_etcd_certificates_expired | default(false) | bool
+
+- name: Restart etcd
+ hosts: oo_etcd_to_config
+ tasks:
+ - name: stop etcd
+ service:
+ name: "{{ 'etcd_container' if openshift.common.etcd_runtime == 'docker' else 'etcd' }}"
+ state: stopped
+ when:
+ - g_etcd_certificates_expired | default(false) | bool
+ - name: start etcd
+ service:
+ name: "{{ 'etcd_container' if openshift.common.etcd_runtime == 'docker' else 'etcd' }}"
+ state: started
+ when:
+ - g_etcd_certificates_expired | default(false) | bool