mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-10-31 14:36:20 -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
|
- name: Download etcd binary
|
||||||
include_tasks: "../../download/tasks/download_file.yml"
|
include_tasks: "../../download/tasks/download_file.yml"
|
||||||
vars:
|
vars:
|
||||||
download: "{{ download_defaults | combine(downloads.etcd) }}"
|
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
|
- name: Copy etcdctl and etcdutl binary from download dir
|
||||||
copy:
|
copy:
|
||||||
@@ -36,7 +13,6 @@
|
|||||||
with_items:
|
with_items:
|
||||||
- etcdctl
|
- etcdctl
|
||||||
- etcdutl
|
- etcdutl
|
||||||
when: container_manager in ['crio', 'containerd']
|
|
||||||
|
|
||||||
- name: Create etcdctl wrapper script
|
- name: Create etcdctl wrapper script
|
||||||
template:
|
template:
|
||||||
|
|||||||
@@ -373,19 +373,24 @@ node_feature_discovery_image_tag: "v{{ node_feature_discovery_version }}"
|
|||||||
|
|
||||||
downloads:
|
downloads:
|
||||||
etcd:
|
etcd:
|
||||||
container: "{{ etcd_deployment_type != 'host' }}"
|
enabled: "{{ etcd_deployment_type == 'host' }}"
|
||||||
file: "{{ etcd_deployment_type == 'host' }}"
|
file: true
|
||||||
enabled: true
|
|
||||||
dest: "{{ local_release_dir }}/etcd-{{ etcd_version }}-linux-{{ image_arch }}.tar.gz"
|
dest: "{{ local_release_dir }}/etcd-{{ etcd_version }}-linux-{{ image_arch }}.tar.gz"
|
||||||
image_name: "{{ etcd_image_repo }}:{{ etcd_image_tag }}"
|
checksum: "{{ etcd_binary_checksum }}"
|
||||||
checksum: "{{ etcd_binary_checksum if etcd_deployment_type == 'host' else None }}"
|
|
||||||
url: "{{ etcd_download_url }}"
|
url: "{{ etcd_download_url }}"
|
||||||
unarchive: "{{ etcd_deployment_type == 'host' }}"
|
unarchive: true
|
||||||
owner: "root"
|
owner: "root"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
groups:
|
groups:
|
||||||
- etcd
|
- etcd
|
||||||
|
|
||||||
|
etcd_container:
|
||||||
|
enabled: "{{ etcd_deployment_type != 'host' }}"
|
||||||
|
container: true
|
||||||
|
image_name: "{{ etcd_image_repo }}:{{ etcd_image_tag }}"
|
||||||
|
groups:
|
||||||
|
- etcd
|
||||||
|
|
||||||
cni:
|
cni:
|
||||||
enabled: true
|
enabled: true
|
||||||
file: true
|
file: true
|
||||||
|
|||||||
Reference in New Issue
Block a user