2016-01-19 22:23:19 +08:00
|
|
|
---
|
2016-06-24 20:25:16 +08:00
|
|
|
- name: Install | Copy etcd binary from downloaddir
|
2016-01-24 01:26:07 +08:00
|
|
|
command: rsync -piu "{{ etcd_bin_dir }}/etcd" "{{ bin_dir }}/etcd"
|
2016-06-24 20:25:16 +08:00
|
|
|
when: etcd_deployment_type == "host"
|
2016-01-24 01:26:07 +08:00
|
|
|
register: etcd_copy
|
2016-07-15 03:33:24 +08:00
|
|
|
changed_when: false
|
2016-01-24 01:26:07 +08:00
|
|
|
|
2016-06-24 20:25:16 +08:00
|
|
|
- name: Install | Copy etcdctl binary from downloaddir
|
2016-01-24 01:26:07 +08:00
|
|
|
command: rsync -piu "{{ etcd_bin_dir }}/etcdctl" "{{ bin_dir }}/etcdctl"
|
2016-06-24 20:25:16 +08:00
|
|
|
when: etcd_deployment_type == "host"
|
|
|
|
changed_when: false
|
|
|
|
|
|
|
|
#Plan A: no docker-py deps
|
|
|
|
- name: Install | Copy etcdctl binary from container
|
2016-12-23 22:44:44 +08:00
|
|
|
command: sh -c "{{ docker_bin_dir }}/docker rm -f etcdctl-binarycopy;
|
|
|
|
{{ docker_bin_dir }}/docker create --name etcdctl-binarycopy {{ etcd_image_repo }}:{{ etcd_image_tag }} &&
|
|
|
|
{{ docker_bin_dir }}/docker cp etcdctl-binarycopy:{{ etcd_container_bin_dir }}etcdctl {{ bin_dir }}/etcdctl &&
|
|
|
|
{{ docker_bin_dir }}/docker rm -f etcdctl-binarycopy"
|
2016-06-24 20:25:16 +08:00
|
|
|
when: etcd_deployment_type == "docker"
|
2016-09-13 20:36:01 +08:00
|
|
|
register: etcd_task_result
|
|
|
|
until: etcd_task_result.rc == 0
|
|
|
|
retries: 4
|
2016-09-15 17:23:27 +08:00
|
|
|
delay: "{{ retry_stagger | random + 3 }}"
|
2016-01-22 23:37:07 +08:00
|
|
|
changed_when: false
|
2016-06-24 20:25:16 +08:00
|
|
|
|
|
|
|
#Plan B: looks nicer, but requires docker-py on all hosts:
|
|
|
|
#- name: Install | Set up etcd-binarycopy container
|
|
|
|
# docker:
|
|
|
|
# name: etcd-binarycopy
|
|
|
|
# state: present
|
|
|
|
# image: "{{ etcd_image_repo }}:{{ etcd_image_tag }}"
|
|
|
|
# when: etcd_deployment_type == "docker"
|
|
|
|
#
|
|
|
|
#- name: Install | Copy etcdctl from etcd-binarycopy container
|
|
|
|
# command: /usr/bin/docker cp "etcd-binarycopy:{{ etcd_container_bin_dir }}etcdctl" "{{ bin_dir }}/etcdctl"
|
|
|
|
# when: etcd_deployment_type == "docker"
|
|
|
|
#
|
|
|
|
#- name: Install | Clean up etcd-binarycopy container
|
|
|
|
# docker:
|
|
|
|
# name: etcd-binarycopy
|
|
|
|
# state: absent
|
|
|
|
# image: "{{ etcd_image_repo }}:{{ etcd_image_tag }}"
|
|
|
|
# when: etcd_deployment_type == "docker"
|