From 706c7cb4f1b234431b789748154d9844085d4bf7 Mon Sep 17 00:00:00 2001 From: Florian Ruynat <16313165+floryut@users.noreply.github.com> Date: Thu, 27 Aug 2020 11:33:01 +0200 Subject: [PATCH] etcd should not fail when adding an already existing member (#6587) --- roles/etcd/tasks/join_etcd_member.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/etcd/tasks/join_etcd_member.yml b/roles/etcd/tasks/join_etcd_member.yml index 24a800bef..6793b6957 100644 --- a/roles/etcd/tasks/join_etcd_member.yml +++ b/roles/etcd/tasks/join_etcd_member.yml @@ -2,7 +2,8 @@ - name: Join Member | Add member to etcd cluster # noqa 301 305 shell: "{{ bin_dir }}/etcdctl member add {{ etcd_member_name }} --peer-urls={{ etcd_peer_url }}" register: member_add_result - until: member_add_result.rc == 0 + until: member_add_result.rc == 0 or 'Peer URLs already exists' in member_add_result.stderr + failed_when: member_add_result.rc != 0 and 'Peer URLs already exists' not in member_add_result.stderr retries: "{{ etcd_retries }}" delay: "{{ retry_stagger | random + 3 }}" environment: