2 - name: check for etcd existed
4 path: "{{ etcd_dir }}/etcd"
10 url={{ etcd_download_url }}
11 dest=/opt/{{ etcd_tarball }}
13 - etcdexisted.stat.exists is undefined or etcdexisted.stat.exists == false
15 - name: extract the etcd tarball
17 src=/opt/{{ etcd_tarball }}
20 - etcdexisted.stat.exists is undefined or etcdexisted.stat.exists == false
22 - name: Check if etcd is running
23 shell: ps aux | grep etcd | grep -v grep
25 register: service_etcd_status
27 - name: run etcd daemon service
28 shell: nohup ./etcd --advertise-client-urls http://{{ etcd_host }}:{{ etcd_port }} --listen-client-urls http://{{ etcd_host }}:{{ etcd_port }} -advertise-client-urls http://{{ etcd_host }}:{{ etcd_peer_port }} -listen-peer-urls http://{{ etcd_host }}:{{ etcd_peer_port }} &>>etcd.log &
31 chdir: "{{ etcd_dir }}"
32 when: service_etcd_status.rc != 0
34 - name: check etcd cluster health
35 shell: ./etcdctl cluster-health
39 chdir: "{{ etcd_dir }}"