File tree Expand file tree Collapse file tree 4 files changed +32
-4
lines changed Expand file tree Collapse file tree 4 files changed +32
-4
lines changed Original file line number Diff line number Diff line change 9
9
when : .image_manifests | default list | len | lt 0
10
10
- name : Export artifact
11
11
command : |
12
- cd {{ .work_dir }} && tar -czvf kubekey-artifact.tar.gz kubekey/
12
+ cd {{ .work_dir }}/kubekey && tar -czvf ../ kubekey-artifact.tar.gz *
Original file line number Diff line number Diff line change 173
173
174
174
- name : Check binaries for calicoctl
175
175
command : |
176
- artifact_name={{ get .artifact.artifact_url. calicoctl .item | splitList "/" | last }}
176
+ artifact_name=calicoctl
177
177
artifact_path={{ .work_dir }}/kubekey/cni/{{ .calico_version }}/{{ .item }}
178
178
if [ ! -f $artifact_path/$artifact_name ]; then
179
179
mkdir -p $artifact_path
Original file line number Diff line number Diff line change 9
9
- name : Extract artifact to work_dir
10
10
tags : ["always"]
11
11
command : |
12
- if [ ! -f "{{ .artifact_file }}" ]; then
13
- tar -zxvf {{ .artifact_file }} -C {{ .work_dir }}
12
+ if [ -f "{{ .artifact_file }}" ]; then
13
+ mkdir -p {{ .work_dir }}/kubekey
14
+ tar -zxvf {{ .artifact_file }} -C {{ .work_dir }}/kubekey
14
15
fi
15
16
when : and .artifact_file (ne .artifact_file "")
16
17
Original file line number Diff line number Diff line change 63
63
dest : /etc/systemd/system/kubelet.service
64
64
- name : Register kubelet service
65
65
command : systemctl daemon-reload && systemctl enable kubelet.service
66
+
67
+ - name : Check if calicoctl is installed
68
+ ignore_errors : true
69
+ command : calicoctl --version
70
+ register : calicoctl_install_version
71
+ - name : Install calicoctl
72
+ when :
73
+ - and .calico_version (ne .calico_version "")
74
+ - |
75
+ or (.calicoctl_install_version.stderr | ne "") (.calicoctl_install_version.stdout | contains (printf "Client Version: %s" .calico_version) | not)
76
+ block :
77
+ - name : Sync calicoctl to remote
78
+ copy :
79
+ src : |
80
+ {{ .work_dir }}/kubekey/cni/{{ .calico_version }}/{{ .binary_type.stdout }}/calicoctl
81
+ dest : /usr/local/bin/calicoctl
82
+ mode : 0755
83
+ - name : Sync kubelet env to remote
84
+ template :
85
+ src : kubeadm/kubelet.env
86
+ dest : /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
87
+ - name : Sync kubelet service to remote
88
+ copy :
89
+ src : kubelet.service
90
+ dest : /etc/systemd/system/kubelet.service
91
+ - name : Register kubelet service
92
+ command : systemctl daemon-reload && systemctl enable kubelet.service
You can’t perform that action at this time.
0 commit comments