Skip to content

Commit

Permalink
Check node_ip is defined when removing etcd node (#6603)
Browse files Browse the repository at this point in the history
  • Loading branch information
floryut authored Sep 1, 2020
1 parent e0b1787 commit 2faf53b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions roles/remove-node/remove-etcd-node/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
when:
- inventory_hostname in groups['etcd']

- name: Make sure node_ip is set
assert:
that: node_ip is defined and node_ip | length > 0
msg: "Etcd node ip is not set !"

- name: Lookup etcd member id
shell: "{{ bin_dir }}/etcdctl member list | grep {{ node_ip }} | cut -d, -f1"
register: etcd_member_id
Expand Down

0 comments on commit 2faf53b

Please sign in to comment.