[virtual] Extend cinder volume size
[fuel.git] / mcp / patches / 0004-maas-region-use-authorized_keys-1st-entry.patch
1 From: Charalampos Kominos <Charalampos.Kominos@enea.com>
2 Date: Sat, 5 Aug 2017 02:03:01 +0200
3 Subject: [PATCH] maas: region: use authorized_keys 1st entry
4
5 MaaS custom py modules accepts the "sshprefs" variable via pillar,
6 however we want to read it from ~ubuntu/.ssh/authorized_keys.
7
8 Bypass the py module and call MaaS CLI directly, passing the first
9 authorized key, which should be mcp.rsa.pub.
10
11 Signed-off-by: Charalampos Kominos <Charalampos.Kominos@enea.com>
12 ---
13
14 diff --git a/maas/region.sls b/maas/region.sls
15 index d3227ca..8a2243d 100644
16 --- a/maas/region.sls
17 +++ b/maas/region.sls
18 @@ -179,8 +179,14 @@
19      - module: maas_config
20
21  maas_sshprefs:
22 -  module.run:
23 -  - name: maas.process_sshprefs
24 +# NOTE(armband): maas.process_sshprefs also works, but we need to read the key
25 +#                from authorized_keys. Should be reworked at some point.
26 +# module.run:
27 +# - name: maas.process_sshprefs
28 +# - require:
29 +  cmd.run:
30 +  - 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\""
31 +  - cwd: "/home/ubuntu/.ssh"
32    - require:
33      - module: maas_config
34