diff --git a/tools/11.deletcd.yml b/tools/11.deletcd.yml index 9bdcd90..71594dc 100644 --- a/tools/11.deletcd.yml +++ b/tools/11.deletcd.yml @@ -34,20 +34,26 @@ - debug: var="ETCD_CLUSTER_STATUS.stdout" + - debug: var="ETCD_CLUSTER_STATUS.stderr" + - name: get a running ectd node - shell: 'echo -e "{{ ETCD_CLUSTER_STATUS.stdout }}"|grep "is healthy"|sed -n "1p"|cut -d: -f2|cut -d/ -f3' + shell: 'echo -e "{{ ETCD_CLUSTER_STATUS.stdout }}" \ + "{{ ETCD_CLUSTER_STATUS.stderr }}" \ + |grep "is healthy"|sed -n "1p"|cut -d: -f2|cut -d/ -f3' register: RUNNING_NODE - debug: var="RUNNING_NODE.stdout" # step2: remove jobs run on the healthy member if needed - name: get ID of etcd node to delete - shell: "ETCDCTL_API=3 {{ bin_dir }}/etcdctl member list|grep {{ ETCD_TO_DEL }}:2380|cut -d',' -f1" + shell: "ETCDCTL_API=3 {{ bin_dir }}/etcdctl member list \ + |grep {{ ETCD_TO_DEL }}:2380|cut -d',' -f1" register: ETCD_ID delegate_to: "{{ RUNNING_NODE.stdout }}" - name: get NAME of etcd node to delete - shell: "ETCDCTL_API=3 {{ bin_dir }}/etcdctl member list|grep {{ ETCD_TO_DEL }}:2380|cut -d' ' -f3|cut -d',' -f1" + shell: "ETCDCTL_API=3 {{ bin_dir }}/etcdctl member list \ + |grep {{ ETCD_TO_DEL }}:2380|cut -d' ' -f3|cut -d',' -f1" register: ETCD_NAME delegate_to: "{{ RUNNING_NODE.stdout }}" diff --git a/tools/12.delnode.yml b/tools/12.delnode.yml index d217ec2..c186e43 100644 --- a/tools/12.delnode.yml +++ b/tools/12.delnode.yml @@ -20,6 +20,8 @@ - debug: var="CLEAN_STATUS.stdout" + - debug: var="CLEAN_STATUS.stderr" + - name: run kubectl delete node {{ NODE_TO_DEL }} shell: "{{ bin_dir }}/kubectl delete node {{ NODE_TO_DEL }}" ignore_errors: true diff --git a/tools/13.delmaster.yml b/tools/13.delmaster.yml index db2996d..85bd4fa 100644 --- a/tools/13.delmaster.yml +++ b/tools/13.delmaster.yml @@ -21,6 +21,8 @@ - debug: var="CLEAN_STATUS.stdout" + - debug: var="CLEAN_STATUS.stderr" + - name: run kubectl delete node {{ NODE_TO_DEL }} shell: "{{ bin_dir }}/kubectl delete node {{ NODE_TO_DEL }}" ignore_errors: true