From 3b14519208dd9d6a611ab59cbba9cd6a1234e3eb Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Wed, 14 Dec 2016 16:44:14 +0300 Subject: [PATCH] Fix etcd member list when upgrading ETCD from an old version --- roles/etcd/tasks/pre_upgrade.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/roles/etcd/tasks/pre_upgrade.yml b/roles/etcd/tasks/pre_upgrade.yml index adaff581f..ea03e23a4 100644 --- a/roles/etcd/tasks/pre_upgrade.yml +++ b/roles/etcd/tasks/pre_upgrade.yml @@ -34,3 +34,12 @@ command: "docker rm -f {{item}}" with_items: "{{etcd_proxy_container.stdout_lines}}" +- name: "Pre-upgrade | check if member list is non-SSL" + command: etcdctl member list + register: etcd_member_list + ignore_errors: true + +- name: "Pre-upgrade | change peer names to SSL" + shell: >- + etcdctl member list | awk -F"[: =]" '{print "etcdctl member update "$1" https:"$7":"$8}' | bash + when: 'etcd_member_list is defined and "http://" in etcd_member_list.stdout'