From 1168d085a2c080bc8b2e413a5fe2ef989341fd39 Mon Sep 17 00:00:00 2001 From: keontang Date: Sat, 10 Sep 2016 16:17:11 +0800 Subject: [PATCH] Let other nodes get kube binary from master[0] (#624) --- .../roles/flannel/defaults/main.yaml | 3 ++- .../roles/kubernetes-base/defaults/main.yml | 3 ++- .../roles/kubernetes-base/files/copy.sh | 26 +++++++++++++++++++ .../roles/kubernetes-base/tasks/qiniu.yml | 19 ++++++++++---- .../roles/prologue/tasks/main.yml | 7 +++++ 5 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 cluster/caicloud-ansible/roles/kubernetes-base/files/copy.sh diff --git a/cluster/caicloud-ansible/roles/flannel/defaults/main.yaml b/cluster/caicloud-ansible/roles/flannel/defaults/main.yaml index f20b3892a8ab9..573f66ca83d28 100644 --- a/cluster/caicloud-ansible/roles/flannel/defaults/main.yaml +++ b/cluster/caicloud-ansible/roles/flannel/defaults/main.yaml @@ -5,7 +5,8 @@ flannel_version: 0.5.5 # The default url to download the flannel tar from. flannel_download_url_base: "http://7xli2p.dl1.z0.glb.clouddn.com" -flannel_download_url: "{{ flannel_download_url_base }}/flannel-{{ flannel_version }}-linux-amd64.tar.gz" +flannel_download_file: "flannel-{{ flannel_version }}-linux-amd64.tar.gz" +flannel_download_url: "{{ flannel_download_url_base }}/{{ flannel_download_file }}" # The backend that flannel should use. flannel_backend: "vxlan" diff --git a/cluster/caicloud-ansible/roles/kubernetes-base/defaults/main.yml b/cluster/caicloud-ansible/roles/kubernetes-base/defaults/main.yml index 0597db76caeff..3c04b82f125ee 100644 --- a/cluster/caicloud-ansible/roles/kubernetes-base/defaults/main.yml +++ b/cluster/caicloud-ansible/roles/kubernetes-base/defaults/main.yml @@ -5,7 +5,8 @@ kube_version: v1.3.3+v0.10.0 # The URL to download Kubernetes binaries from. kube_download_url_base: "http://7xli2p.dl1.z0.glb.clouddn.com" -kube_download_url: "{{ kube_download_url_base }}/caicloud-kube-{{ kube_version }}.tar.gz" +kube_download_file: "caicloud-kube-{{ kube_version }}.tar.gz" +kube_download_url: "{{ kube_download_url_base }}/{{ kube_download_file }}" # # DO NOT CHANGE section diff --git a/cluster/caicloud-ansible/roles/kubernetes-base/files/copy.sh b/cluster/caicloud-ansible/roles/kubernetes-base/files/copy.sh new file mode 100644 index 0000000000000..0da2dd29dfa78 --- /dev/null +++ b/cluster/caicloud-ansible/roles/kubernetes-base/files/copy.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Copy files from master by scp command in expect script. +# +# Assumed vars: +# REMOTE_FILE_NAME +# REMOTE_USER +# REMOTE_IP +# REMOTE_PASSWORD +# DEST_PATH + +expect <