From af65ce60c5ab69816cbe8b4c1c7b4c5922304205 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Tue, 13 Feb 2018 03:34:10 +0100 Subject: [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 --- mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/maas_pdf.yml.j2 | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mcp/reclass/classes') diff --git a/mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/maas_pdf.yml.j2 b/mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/maas_pdf.yml.j2 index a875993e3..cff6d9b30 100644 --- a/mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/maas_pdf.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/maas_pdf.yml.j2 @@ -9,6 +9,8 @@ parameters: maas: region: + sshprefs: + - '{{ conf.MAAS_SSH_KEY }}' machines: {%- set pxe_interface = conf.idf.net_config.admin.interface %} {#- We only support exactly 5 nodes for now, hardcoded order #} -- cgit 1.2.3-korg