diff options
author | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2019-07-11 21:20:15 +0200 |
---|---|---|
committer | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2019-07-11 21:27:22 +0200 |
commit | c950e71d004ee8871c01af564ffac5347416dd10 (patch) | |
tree | b2c6b22bd8b3ccda07e531b66c69306656d51e7e /mcp/config/states | |
parent | e8905d1c928a2e674ff399d96384466572f985b3 (diff) |
[iec] Copy private RSA key to K8s master
Certain validation testing suites require the SSH RSA private key to
to be available on the K8s master node.
Change-Id: Ib496ac6b33642d86bfd0e0f72ee847a2f31ea952
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'mcp/config/states')
-rwxr-xr-x | mcp/config/states/akraino_iec | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mcp/config/states/akraino_iec b/mcp/config/states/akraino_iec index e61ca9451..efe0d4df0 100755 --- a/mcp/config/states/akraino_iec +++ b/mcp/config/states/akraino_iec @@ -9,9 +9,11 @@ ############################################################################## CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x +SCRIPTS_DIR=$(dirname "${BASH_SOURCE[0]}")/../../scripts -source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/lib.sh" -source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/xdf_data.sh" +source "${SCRIPTS_DIR}/lib.sh" +source "${SCRIPTS_DIR}/xdf_data.sh" +source "${SCRIPTS_DIR}/globals.sh" IEC_REPO_URI='https://gerrit.akraino.org/r/iec' IEC_USER_L='ubuntu' @@ -40,7 +42,10 @@ salt -C 'iec*' cmd.run runas="${IEC_USER}" "${IEC_SCRIPTS_PATH}/k8s_common.sh" IEC_MASTER_IP=$(salt --out txt -C 'iec* and *01*' pillar.get \ _param:single_address | cut -d ' ' -f2) salt -C 'iec* and *01*' cmd.run runas="${IEC_USER}" \ - "${IEC_SCRIPTS_PATH}/k8s_master.sh ${IEC_MASTER_IP} ${POD_NETWORK_CIDR}" + stdin="$(sed -z 's/\n/\\n/g' "${SCRIPTS_DIR}/$(basename "${SSH_KEY}")")" \ + "mkdir -p .ssh && touch .ssh/id_rsa && chmod 600 .ssh/id_rsa && \ + cat > .ssh/id_rsa && \ + ${IEC_SCRIPTS_PATH}/k8s_master.sh ${IEC_MASTER_IP} ${POD_NETWORK_CIDR}" KUBE_NODE_CNT=$(salt --out txt -C 'iec* and *01*' cmd.run runas="${IEC_USER}" \ 'kubectl get nodes | grep -c -e "^iec"' | cut -d ' ' -f2) |