diff --git a/roles/etcdctl_etcdutl/tasks/main.yml b/roles/etcdctl_etcdutl/tasks/main.yml index cf4d4ea38..324cdcf3e 100644 --- a/roles/etcdctl_etcdutl/tasks/main.yml +++ b/roles/etcdctl_etcdutl/tasks/main.yml @@ -1,31 +1,8 @@ --- -- name: Copy etcdctl and etcdutl binary from docker container - command: sh -c "{{ docker_bin_dir }}/docker rm -f etcdxtl-binarycopy; - {{ docker_bin_dir }}/docker create --name etcdxtl-binarycopy {{ etcd_image_repo }}:{{ etcd_image_tag }} && - {{ docker_bin_dir }}/docker cp etcdxtl-binarycopy:/usr/local/bin/{{ item }} {{ bin_dir }}/{{ item }} && - {{ docker_bin_dir }}/docker rm -f etcdxtl-binarycopy" - with_items: - - etcdctl - - etcdutl - register: etcdxtl_install_result - until: etcdxtl_install_result.rc == 0 - retries: 4 - delay: "{{ retry_stagger | random + 3 }}" - changed_when: false - when: container_manager == "docker" - - name: Download etcd binary include_tasks: "../../download/tasks/download_file.yml" vars: download: "{{ download_defaults | combine(downloads.etcd) }}" - when: container_manager in ['crio', 'containerd'] - -- name: Copy etcd binary - unarchive: - src: "{{ downloads.etcd.dest }}" - dest: "{{ local_release_dir }}/" - remote_src: true - when: container_manager in ['crio', 'containerd'] - name: Copy etcdctl and etcdutl binary from download dir copy: @@ -36,7 +13,6 @@ with_items: - etcdctl - etcdutl - when: container_manager in ['crio', 'containerd'] - name: Create etcdctl wrapper script template: diff --git a/roles/kubespray_defaults/defaults/main/download.yml b/roles/kubespray_defaults/defaults/main/download.yml index df18e10af..b70fa0a4d 100644 --- a/roles/kubespray_defaults/defaults/main/download.yml +++ b/roles/kubespray_defaults/defaults/main/download.yml @@ -373,19 +373,24 @@ node_feature_discovery_image_tag: "v{{ node_feature_discovery_version }}" downloads: etcd: - container: "{{ etcd_deployment_type != 'host' }}" - file: "{{ etcd_deployment_type == 'host' }}" - enabled: true + enabled: "{{ etcd_deployment_type == 'host' }}" + file: true dest: "{{ local_release_dir }}/etcd-{{ etcd_version }}-linux-{{ image_arch }}.tar.gz" - image_name: "{{ etcd_image_repo }}:{{ etcd_image_tag }}" - checksum: "{{ etcd_binary_checksum if etcd_deployment_type == 'host' else None }}" + checksum: "{{ etcd_binary_checksum }}" url: "{{ etcd_download_url }}" - unarchive: "{{ etcd_deployment_type == 'host' }}" + unarchive: true owner: "root" mode: "0755" groups: - etcd + etcd_container: + enabled: "{{ etcd_deployment_type != 'host' }}" + container: true + image_name: "{{ etcd_image_repo }}:{{ etcd_image_tag }}" + groups: + - etcd + cni: enabled: true file: true