aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-11-27 00:11:28 +0100
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-11-27 00:33:03 +0100
commit9a96a6292f82411a00faf373ca180cb32c26061c (patch)
treef9a4ec3c5d9bbcc4d0257bd1cc103661e92344eb
parent8a867449217151f59766a74c6165ffc26c7f50b4 (diff)
[baremetal] MaaS: Fix adding mcp.rsa.pub
Upstream salt-formula-maas change [1] gated applying "maas_sshprefs" low state by `region.sshprefs` being declared in reclass, which is not true for our model. Mend our region.sls patch to pass mcp.rsa.pub to MaaS unconditionally. This fixes baremetal SSH login with mcp.rsa. While at it, fix duplicate SSH key upload on MaaS state retry. JIRA: FUEL-281 [1] https://github.com/salt-formulas/salt-formula-maas/commit/ec61dd6 Change-Id: I93941a689058f9f48f34861898fbe3ee6ce4e2b4 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-rw-r--r--mcp/patches/0004-maas-region-use-authorized_keys-1st-entry.patch9
1 files changed, 6 insertions, 3 deletions
diff --git a/mcp/patches/0004-maas-region-use-authorized_keys-1st-entry.patch b/mcp/patches/0004-maas-region-use-authorized_keys-1st-entry.patch
index 9be6ca5a9..a4fb44b05 100644
--- a/mcp/patches/0004-maas-region-use-authorized_keys-1st-entry.patch
+++ b/mcp/patches/0004-maas-region-use-authorized_keys-1st-entry.patch
@@ -20,12 +20,13 @@ Signed-off-by: Charalampos Kominos <Charalampos.Kominos@enea.com>
---
diff --git a/maas/region.sls b/maas/region.sls
-index d3227ca..8a2243d 100644
--- a/maas/region.sls
+++ b/maas/region.sls
-@@ -179,8 +179,14 @@
+@@ -242,12 +242,16 @@
+ - require:
- module: maas_config
+-{%- if region.get('sshprefs', False) %}
maas_sshprefs:
- module.run:
- - name: maas.process_sshprefs
@@ -35,8 +36,10 @@ index d3227ca..8a2243d 100644
+# - name: maas.process_sshprefs
+# - require:
+ cmd.run:
-+ - name: "maas login {{ region.admin.username }} http://{{ region.bind.host }}:5240/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && SSH_KEY=$(cat authorized_keys | head -1) && maas opnfv sshkeys create \"key=$SSH_KEY\""
++ - name: "maas login {{ region.admin.username }} http://{{ region.bind.host }}:5240/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && SSH_KEY=$(cat authorized_keys | head -1) && (maas opnfv sshkeys read | grep -q \"$SSH_KEY\" || maas opnfv sshkeys create \"key=$SSH_KEY\")"
+ - cwd: "/home/ubuntu/.ssh"
- require:
- module: maas_config
+-{%- endif %}
+ {%- endif %}