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.

39 lines
1.5 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. changed_when: false
  19. #Plan B: looks nicer, but requires docker-py on all hosts:
  20. #- name: Install | Set up etcd-binarycopy container
  21. # docker:
  22. # name: etcd-binarycopy
  23. # state: present
  24. # image: "{{ etcd_image_repo }}:{{ etcd_image_tag }}"
  25. # when: etcd_deployment_type == "docker"
  26. #
  27. #- name: Install | Copy etcdctl from etcd-binarycopy container
  28. # command: /usr/bin/docker cp "etcd-binarycopy:{{ etcd_container_bin_dir }}etcdctl" "{{ bin_dir }}/etcdctl"
  29. # when: etcd_deployment_type == "docker"
  30. #
  31. #- name: Install | Clean up etcd-binarycopy container
  32. # docker:
  33. # name: etcd-binarycopy
  34. # state: absent
  35. # image: "{{ etcd_image_repo }}:{{ etcd_image_tag }}"
  36. # when: etcd_deployment_type == "docker"