Merge pull request #1055 from mattymo/etcd-preupgrade-speedup
speed up etcd preupgrade checkpull/1061/head
commit
d4f15ab402
|
@ -34,6 +34,11 @@
|
|||
command: "{{ docker_bin_dir }}/docker rm -f {{item}}"
|
||||
with_items: "{{etcd_proxy_container.stdout_lines}}"
|
||||
|
||||
- name: "Pre-upgrade | see if etcdctl is installed"
|
||||
stat:
|
||||
path: "{{ bin_dir }}/etcdctl"
|
||||
register: etcdctl_installed
|
||||
|
||||
- name: "Pre-upgrade | check if member list is non-SSL"
|
||||
command: "{{ bin_dir }}/etcdctl --no-sync --peers={{ etcd_access_addresses | regex_replace('https','http') }} member list"
|
||||
register: etcd_member_list
|
||||
|
@ -41,6 +46,7 @@
|
|||
delay: 3
|
||||
until: etcd_member_list.rc != 2
|
||||
run_once: true
|
||||
when: etcdctl_installed.stat.exists
|
||||
failed_when: false
|
||||
|
||||
- name: "Pre-upgrade | change peer names to SSL"
|
||||
|
@ -48,4 +54,4 @@
|
|||
{{ bin_dir }}/etcdctl --no-sync --peers={{ etcd_access_addresses | regex_replace('https','http') }} member list |
|
||||
awk -F"[: =]" '{print "{{ bin_dir }}/etcdctl --peers={{ etcd_access_addresses | regex_replace('https','http') }} member update "$1" https:"$7":"$8}' | bash
|
||||
run_once: true
|
||||
when: 'etcd_member_list.rc == 0 and "http://" in etcd_member_list.stdout'
|
||||
when: 'etcdctl_installed.stat.exists and etcd_member_list.rc == 0 and "http://" in etcd_member_list.stdout'
|
||||
|
|
Loading…
Reference in New Issue