aboutsummaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-02-13 03:34:10 +0100
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-02-13 19:47:17 +0100
commitaf65ce60c5ab69816cbe8b4c1c7b4c5922304205 (patch)
treeece84798bf9b73ca7036d136886bb9525b41f806 /ci
parentbfc61428e35c92cbed253e98133d7891cc2d6833 (diff)
[patch] MaaS: mcp.rsa.pub to auth keys via pillar
Drop one questionable patch responsible for MaaS node authorized keys to include mcp.rsa.pub by reading the contents of authorized keys on mas01, assuming mcp.rsa.pub will be on the first line. Instead, export the contents of the public key using a shell env var during deploy, which gets expanded via maas_pdf j2 template into a reclass param, leveraging existing salt-formula-maas sshprefs mechanism for delivering the key to MaaS. Since we require the public key to exist before expanding templates, move `generate_ssh_key` call outside the current infrastructure handling block, allowing it to execute during all `deploy.sh` calls, even for dry-runs. Change-Id: I0f53b0f764a2fafd292e0ffd399c284acf61bd30 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'ci')
-rwxr-xr-xci/deploy.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh
index ed438324b..c883616f1 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -280,6 +280,10 @@ eval "$(parse_yaml "${SCENARIO_DIR}/defaults-$(uname -i).yaml")"
eval "$(parse_yaml "${SCENARIO_DIR}/${DEPLOY_SCENARIO}.yaml")"
export CLUSTER_DOMAIN=${cluster_domain}
+# key might not exist yet ...
+generate_ssh_key
+export MAAS_SSH_KEY="$(cat "$(basename "${SSH_KEY}").pub")"
+
# Expand jinja2 templates based on PDF data and env vars
do_templates "${REPO_ROOT_PATH}" "${STORAGE_DIR}" "${TARGET_LAB}" \
"${TARGET_POD}" "${BASE_CONFIG_URI}"
@@ -336,7 +340,6 @@ elif [ ${USE_EXISTING_INFRA} -gt 0 ]; then
notify "[NOTE] Use existing infra" 2
check_connection
else
- generate_ssh_key
prepare_vms "${base_image}" "${STORAGE_DIR}" "${virtual_repos_pkgs}" \
"${virtual_nodes[@]}"
create_networks "${OPNFV_BRIDGES[@]}"