states/maas: Add mcp.rsa.pub to authorized_keys 09/39909/3
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Tue, 22 Aug 2017 20:04:28 +0000 (22:04 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Wed, 23 Aug 2017 02:43:32 +0000 (04:43 +0200)
Add our mcp.rsa.pub RSA key to all nodes, including VCP VMs.
This is required for functest to be able to fetch openrc.

While at it, add retry wrappers for more VCP VM state.sls calls.

Change-Id: I34f79848c52e36de8d981055880321a081420874
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Signed-off-by: Guillermo Herrero <Guillermo.Herrero@enea.com>
mcp/config/states/maas

index 52a9b77..fecd991 100755 (executable)
@@ -69,6 +69,9 @@ while [ $rc -ne 0 ]; do
   sleep 5
 done
 
-salt -C '* and not cfg01* and not mas01*' saltutil.sync_all
+wait_for "salt -C '* and not cfg01* and not mas01*' ssh.set_auth_key ${SUDO_USER} \
+  $(awk 'NR==1{print $2}' $(eval echo ~${SUDO_USER}/.ssh/authorized_keys))"
+
+wait_for "salt -C '* and not cfg01* and not mas01*' saltutil.sync_all"
 salt -C '* and not cfg01* and not mas01*' state.apply salt
 wait_for "salt -C '* and not cfg01* and not mas01*' state.apply linux,ntp"