|
| 1 | +- name: Binary | Ensure etcd binary is present |
| 2 | + tags: ["etcd"] |
| 3 | + loop: "{{ .download.arch | toJson }}" |
| 4 | + when: |
| 5 | + - .etcd.deployment_type | eq "external" |
| 6 | + - .etcd.etcd_version | empty | not |
| 7 | + command: | |
| 8 | + artifact_name={{ get .download.artifact_url.etcd .item | splitList "/" | last }} |
| 9 | + artifact_path={{ .binary_dir }}/etcd/{{ .etcd.etcd_version }}/{{ .item }} |
| 10 | + target_path={{ .artifact_file_dir }}/kubekey/kubekey/etcd/{{ .etcd.etcd_version }}/{{ .item }} |
| 11 | + mkdir -p $target_path |
| 12 | + cp $artifact_path/$artifact_name $target_path/ |
| 13 | +
|
| 14 | +- name: Binary | Ensure Kubernetes binaries are present |
| 15 | + tags: ["kubernetes"] |
| 16 | + loop: "{{ .download.arch | toJson }}" |
| 17 | + when: .kubernetes.kube_version | empty | not |
| 18 | + command: | |
| 19 | + kube_path={{ .binary_dir }}/kube/{{ .kubernetes.kube_version }}/{{ .item }} |
| 20 | + target_path={{ .artifact_file_dir }}/kubekey/kubekey/kube/{{ .kubernetes.kube_version }}/{{ .item }} |
| 21 | + mkdir -p $target_path |
| 22 | + cp $kube_path/kubelet $target_path/ |
| 23 | + cp $kube_path/kubeadm $target_path/ |
| 24 | + cp $kube_path/kubectl $target_path/ |
| 25 | +
|
| 26 | +- name: Binary | Ensure CNI plugins are present |
| 27 | + tags: ["kubernetes"] |
| 28 | + loop: "{{ .download.arch | toJson }}" |
| 29 | + when: .cni.cni_plugins_version | empty | not |
| 30 | + command: | |
| 31 | + artifact_name={{ get .download.artifact_url.cni_plugins .item | splitList "/" | last }} |
| 32 | + artifact_path={{ .binary_dir }}/cni/plugins/{{ .cni.cni_plugins_version }}/{{ .item }} |
| 33 | + target_path={{ .artifact_file_dir }}/kubekey/kubekey/cni/plugins/{{ .cni.cni_plugins_version }}/{{ .item }} |
| 34 | + mkdir -p $target_path |
| 35 | + cp $artifact_path/$artifact_name $target_path/ |
| 36 | +
|
| 37 | +- name: Binary | Ensure Helm binary is present |
| 38 | + tags: ["kubernetes"] |
| 39 | + loop: "{{ .download.arch | toJson }}" |
| 40 | + when: .kubernetes.helm_version | empty | not |
| 41 | + command: | |
| 42 | + artifact_name={{ get .download.artifact_url.helm .item | splitList "/" | last }} |
| 43 | + artifact_path={{ .binary_dir }}/helm/{{ .kubernetes.helm_version }}/{{ .item }} |
| 44 | + target_path={{ .artifact_file_dir }}/kubekey/kubekey/helm/{{ .kubernetes.helm_version }}/{{ .item }} |
| 45 | + mkdir -p $target_path |
| 46 | + cp $artifact_path/$artifact_name $target_path/ |
| 47 | +
|
| 48 | +- name: Binary | Ensure crictl binary is present |
| 49 | + tags: ["kubernetes"] |
| 50 | + loop: "{{ .download.arch | toJson }}" |
| 51 | + when: .cri.crictl_version | empty | not |
| 52 | + command: | |
| 53 | + artifact_name={{ get .download.artifact_url.crictl .item | splitList "/" | last }} |
| 54 | + artifact_path={{ .binary_dir }}/crictl/{{ .cri.crictl_version }}/{{ .item }} |
| 55 | + target_path={{ .artifact_file_dir }}/kubekey/kubekey/crictl/{{ .cri.crictl_version }}/{{ .item }} |
| 56 | + mkdir -p $target_path |
| 57 | + cp $artifact_path/$artifact_name $target_path/ |
| 58 | +
|
| 59 | +- name: Binary | Ensure Docker binary is present |
| 60 | + tags: ["kubernetes","image_registry"] |
| 61 | + loop: "{{ .download.arch | toJson }}" |
| 62 | + when: |
| 63 | + - .cri.docker_version | empty | not |
| 64 | + - or (.image_registry.type | empty | not) (.cri.container_manager | eq "docker") |
| 65 | + command: | |
| 66 | + artifact_name={{ get .download.artifact_url.docker .item | splitList "/" | last }} |
| 67 | + artifact_path={{ .binary_dir }}/docker/{{ .cri.docker_version }}/{{ .item }} |
| 68 | + target_path={{ .artifact_file_dir }}/kubekey/kubekey/docker/{{ .cri.docker_version }}/{{ .item }} |
| 69 | + mkdir -p $target_path |
| 70 | + cp $artifact_path/$artifact_name $target_path/ |
| 71 | +
|
| 72 | +- name: Binary | Ensure cri-dockerd binary is present |
| 73 | + tags: ["kubernetes"] |
| 74 | + loop: "{{ .download.arch | toJson }}" |
| 75 | + when: |
| 76 | + - .cri.cridockerd_version | empty | not |
| 77 | + - .cri.container_manager | eq "docker" |
| 78 | + - .kubernetes.kube_version | semverCompare ">=v1.24.0" |
| 79 | + command: | |
| 80 | + artifact_name={{ get .download.artifact_url.cridockerd .item | splitList "/" | last }} |
| 81 | + artifact_path={{ .binary_dir }}/cri-dockerd/{{ .cri.cridockerd_version }}/{{ .item }} |
| 82 | + target_path={{ .artifact_file_dir }}/kubekey/kubekey/cri-dockerd/{{ .cri.cridockerd_version }}/{{ .item }} |
| 83 | + mkdir -p $target_path |
| 84 | + cp $artifact_path/$artifact_name $target_path/ |
| 85 | +
|
| 86 | +- name: Binary | Ensure containerd binary is present |
| 87 | + tags: ["kubernetes"] |
| 88 | + loop: "{{ .download.arch | toJson }}" |
| 89 | + when: |
| 90 | + - .cri.containerd_version | empty | not |
| 91 | + - .cri.container_manager | eq "containerd" |
| 92 | + command: | |
| 93 | + artifact_name={{ get .download.artifact_url.containerd .item | splitList "/" | last }} |
| 94 | + artifact_path={{ .binary_dir }}/containerd/{{ .cri.containerd_version }}/{{ .item }} |
| 95 | + target_path={{ .artifact_file_dir }}/kubekey/kubekey/containerd/{{ .cri.containerd_version }}/{{ .item }} |
| 96 | + mkdir -p $target_path |
| 97 | + cp $artifact_path/$artifact_name $target_path/ |
| 98 | +
|
| 99 | +- name: Binary | Ensure runc binary is present |
| 100 | + tags: ["kubernetes"] |
| 101 | + loop: "{{ .download.arch | toJson }}" |
| 102 | + when: |
| 103 | + - .cri.runc_version | empty | not |
| 104 | + - .cri.container_manager | eq "containerd" |
| 105 | + command: | |
| 106 | + artifact_name={{ get .download.artifact_url.runc .item | splitList "/" | last }} |
| 107 | + artifact_path={{ .binary_dir }}/runc/{{ .cri.runc_version }}/{{ .item }} |
| 108 | + target_path={{ .artifact_file_dir }}/kubekey/kubekey/runc/{{ .cri.runc_version }}/{{ .item }} |
| 109 | + mkdir -p $target_path |
| 110 | + cp $artifact_path/$artifact_name $target_path/ |
| 111 | +
|
| 112 | +- name: Binary | Ensure calicoctl binary is present |
| 113 | + tags: ["kubernetes"] |
| 114 | + loop: "{{ .download.arch | toJson }}" |
| 115 | + when: |
| 116 | + - .cni.calico_version | empty | not |
| 117 | + - .cni.type | eq "calico" |
| 118 | + command: | |
| 119 | + artifact_name=calicoctl |
| 120 | + artifact_path={{ .binary_dir }}/cni/calico/{{ .cni.calico_version }}/{{ .item }} |
| 121 | + target_path={{ .artifact_file_dir }}/kubekey/kubekey/cni/calico/{{ .cni.calico_version }}/{{ .item }} |
| 122 | + mkdir -p $target_path |
| 123 | + cp $artifact_path/$artifact_name $target_path/ |
| 124 | +
|
| 125 | +- name: Binary | Ensure Docker Registry binary is present |
| 126 | + tags: ["image_registry"] |
| 127 | + loop: "{{ .download.arch | toJson }}" |
| 128 | + when: |
| 129 | + - .image_registry.docker_registry_version | empty | not |
| 130 | + - .image_registry.type | eq "docker-registry" |
| 131 | + command: | |
| 132 | + artifact_name={{ get .download.artifact_url.docker_registry .item | splitList "/" | last }} |
| 133 | + artifact_path={{ .binary_dir }}/image-registry/docker-registry/{{ .image_registry.docker_registry_version }}/{{ .item }} |
| 134 | + target_path={{ .artifact_file_dir }}/kubekey/kubekey/image-registry/docker-registry/{{ .image_registry.docker_registry_version }}/{{ .item }} |
| 135 | + mkdir -p $target_path |
| 136 | + cp $artifact_path/$artifact_name $target_path/ |
| 137 | +
|
| 138 | +- name: Binary | Ensure docker-compose binary is present |
| 139 | + tags: ["image_registry"] |
| 140 | + loop: "{{ .download.arch | toJson }}" |
| 141 | + when: |
| 142 | + - .cri.dockercompose_version | empty | not |
| 143 | + - .image_registry.type | eq "harbor" |
| 144 | + command: | |
| 145 | + compose_name=docker-compose |
| 146 | + compose_path={{ .binary_dir }}/image-registry/docker-compose/{{ .cri.dockercompose_version }}/{{ .item }} |
| 147 | + target_path={{ .artifact_file_dir }}/kubekey/kubekey/image-registry/docker-compose/{{ .cri.dockercompose_version }}/{{ .item }} |
| 148 | + mkdir -p $target_path |
| 149 | + cp $compose_path/$compose_name $target_path/ |
| 150 | +
|
| 151 | +- name: Binary | Ensure Harbor binary is present |
| 152 | + tags: ["image_registry"] |
| 153 | + loop: "{{ .download.arch | toJson }}" |
| 154 | + when: |
| 155 | + - .image_registry.harbor_version | empty | not |
| 156 | + - .image_registry.type | eq "harbor" |
| 157 | + command: | |
| 158 | + harbor_name={{ get .download.artifact_url.harbor .item | splitList "/" | last }} |
| 159 | + harbor_path={{ .binary_dir }}/image-registry/harbor/{{ .image_registry.harbor_version }}/{{ .item }} |
| 160 | + target_path={{ .artifact_file_dir }}/kubekey/kubekey/image-registry/harbor/{{ .image_registry.harbor_version }}/{{ .item }} |
| 161 | + mkdir -p $target_path |
| 162 | + cp $harbor_path/$harbor_name $target_path/ |
| 163 | +
|
| 164 | +- name: Binary | Ensure keepalived binary is present |
| 165 | + tags: ["image_registry"] |
| 166 | + loop: "{{ .download.arch | toJson }}" |
| 167 | + when: |
| 168 | + - .image_registry.keepalived_version | empty | not |
| 169 | + - .image_registry.ha_vip | empty | not |
| 170 | + - .groups.image_registry | len | lt 1 |
| 171 | + command: | |
| 172 | + artifact_name={{ get .download.artifact_url.keepalived .item | splitList "/" | last }} |
| 173 | + artifact_path={{ .binary_dir }}/image-registry/keepalived/{{ .keepalived_version }}/{{ .item }} |
| 174 | + target_path={{ .artifact_file_dir }}/kubekey/kubekey/image-registry/keepalived/{{ .keepalived_version }}/{{ .item }} |
| 175 | + mkdir -p $target_path |
| 176 | + cp $artifact_path/$artifact_name $target_path/ |
0 commit comments