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.

45 lines
1.5 KiB

  1. ---
  2. - name: Copy etcdctl and etcdutl binary from docker container
  3. command: sh -c "{{ docker_bin_dir }}/docker rm -f etcdxtl-binarycopy;
  4. {{ docker_bin_dir }}/docker create --name etcdxtl-binarycopy {{ etcd_image_repo }}:{{ etcd_image_tag }} &&
  5. {{ docker_bin_dir }}/docker cp etcdxtl-binarycopy:/usr/local/bin/{{ item }} {{ bin_dir }}/{{ item }} &&
  6. {{ docker_bin_dir }}/docker rm -f etcdxtl-binarycopy"
  7. with_items:
  8. - etcdctl
  9. - etcdutl
  10. register: etcdxtl_install_result
  11. until: etcdxtl_install_result.rc == 0
  12. retries: 4
  13. delay: "{{ retry_stagger | random + 3 }}"
  14. changed_when: false
  15. when: container_manager == "docker"
  16. - name: Download etcd binary
  17. include_tasks: "../../download/tasks/download_file.yml"
  18. vars:
  19. download: "{{ download_defaults | combine(downloads.etcd) }}"
  20. when: container_manager in ['crio', 'containerd']
  21. - name: Copy etcd binary
  22. unarchive:
  23. src: "{{ downloads.etcd.dest }}"
  24. dest: "{{ local_release_dir }}/"
  25. remote_src: true
  26. when: container_manager in ['crio', 'containerd']
  27. - name: Copy etcdctl and etcdutl binary from download dir
  28. copy:
  29. src: "{{ local_release_dir }}/etcd-{{ etcd_version }}-linux-{{ host_architecture }}/{{ item }}"
  30. dest: "{{ bin_dir }}/{{ item }}"
  31. mode: "0755"
  32. remote_src: true
  33. with_items:
  34. - etcdctl
  35. - etcdutl
  36. when: container_manager in ['crio', 'containerd']
  37. - name: Create etcdctl wrapper script
  38. template:
  39. src: etcdctl.sh.j2
  40. dest: "{{ bin_dir }}/etcdctl.sh"
  41. mode: "0755"