2 - name: check for etcd existed
\r
4 path: "{{ etcd_dir }}/etcd"
\r
6 register: etcdexisted
\r
8 - name: download etcd
\r
10 url={{ etcd_download_url }}
\r
11 dest=/opt/{{ etcd_tarball }}
\r
13 - etcdexisted.stat.exists is undefined or etcdexisted.stat.exists == false
\r
15 - name: extract the etcd tarball
\r
17 src=/opt/{{ etcd_tarball }}
\r
20 - etcdexisted.stat.exists is undefined or etcdexisted.stat.exists == false
\r
22 - name: Check if etcd is running
\r
23 shell: ps aux | grep etcd | grep -v grep
\r
25 register: service_etcd_status
\r
27 - name: run etcd daemon service
\r
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 &
\r
31 chdir: "{{ etcd_dir }}"
\r
32 when: service_etcd_status.rc != 0
\r
34 - name: check etcd cluster health
\r
35 shell: ./etcdctl cluster-health
\r
39 chdir: "{{ etcd_dir }}"
\r