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.

32 lines
1.3 KiB

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