You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.7 KiB

  1. ---
  2. - name: Install | Copy etcd binary from downloaddir
  3. command: rsync -piu "{{ etcd_bin_dir }}/etcd" "{{ bin_dir }}/etcd"
  4. when: etcd_deployment_type == "host"
  5. register: etcd_copy
  6. changed_when: false
  7. - name: Install | Copy etcdctl binary from downloaddir
  8. command: rsync -piu "{{ etcd_bin_dir }}/etcdctl" "{{ bin_dir }}/etcdctl"
  9. when: etcd_deployment_type == "host"
  10. changed_when: false
  11. #Plan A: no docker-py deps
  12. - name: Install | Copy etcdctl binary from container
  13. command: sh -c "/usr/bin/docker rm -f etcdctl-binarycopy;
  14. /usr/bin/docker create --name etcdctl-binarycopy {{ etcd_image_repo }}:{{ etcd_image_tag }} &&
  15. /usr/bin/docker cp etcdctl-binarycopy:{{ etcd_container_bin_dir }}etcdctl {{ bin_dir }}/etcdctl &&
  16. /usr/bin/docker rm -f etcdctl-binarycopy"
  17. when: etcd_deployment_type == "docker"
  18. register: etcd_task_result
  19. until: etcd_task_result.rc == 0
  20. retries: 4
  21. delay: "{{ retry_stagger | random + 3 }}"
  22. changed_when: false
  23. #Plan B: looks nicer, but requires docker-py on all hosts:
  24. #- name: Install | Set up etcd-binarycopy container
  25. # docker:
  26. # name: etcd-binarycopy
  27. # state: present
  28. # image: "{{ etcd_image_repo }}:{{ etcd_image_tag }}"
  29. # when: etcd_deployment_type == "docker"
  30. #
  31. #- name: Install | Copy etcdctl from etcd-binarycopy container
  32. # command: /usr/bin/docker cp "etcd-binarycopy:{{ etcd_container_bin_dir }}etcdctl" "{{ bin_dir }}/etcdctl"
  33. # when: etcd_deployment_type == "docker"
  34. #
  35. #- name: Install | Clean up etcd-binarycopy container
  36. # docker:
  37. # name: etcd-binarycopy
  38. # state: absent
  39. # image: "{{ etcd_image_repo }}:{{ etcd_image_tag }}"
  40. # when: etcd_deployment_type == "docker"