mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-10-29 22:03:22 -02:30
downloads: separate etcd and etcd_container (#13555)
Mixing two semantically distincts artefacts makes things harder to read and to consume from other code. Needed for clean filtering on container / file.
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user