]> gitweb.fluxo.info Git - hydra.git/commitdiff
Deploy: test for borg key
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 23 May 2018 20:50:43 +0000 (17:50 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 23 May 2018 20:50:43 +0000 (17:50 -0300)
share/hydra/deploy

index 2b914d3cac92fc202b162b834a2c46a2bea408f6..9736c1dff94ddac0ef1383d45a7d34edcc3b3d8a 100755 (executable)
@@ -89,7 +89,8 @@ for node in $NODES; do
       tee $HYDRA_FOLDER/puppet/logs/$FQDN.`date +%Y%m%d%H%M`.log
 
     # Check if keys should be imported
-    if ! $SUDO test -f $FOLDER/root/.ssh/id_rsa; then
+    #if ! $SUDO test -f $FOLDER/root/.ssh/id_rsa; then
+    if ! $SUDO test -f $FOLDER/root/.borg/hydra/key; then
       echo "No $FOLDER/root/.ssh/id_rsa found. Please import it and other keys when the system is online using import-keys action"
     fi
   elif [ "$node" == "localhost" ] || [ "$node" == "`facter fqdn`" ] || [ "$node" == "`facter hostname`" ]; then
@@ -128,7 +129,8 @@ for node in $NODES; do
     $SUDO chown -R `whoami`. $HYDRA_FOLDER/puppet/ssl
 
     # Import keys if needed
-    if ! $SUDO test -f /root/.ssh/id_rsa; then
+    #if ! $SUDO test -f /root/.ssh/id_rsa; then
+    if ! $SUDO test -f /root/.borg/hydra/key; then
       hydra $HYDRA import-keys localhost
     fi
   else
@@ -211,7 +213,8 @@ EOF
       tee $HYDRA_FOLDER/puppet/logs/$FQDN.`date +%Y%m%d%H%M`.log
 
     # Import keys if needed
-    if ! $HYDRA_CONNECT $FQDN sudo test -f /root/.ssh/id_rsa; then
+    #if ! $HYDRA_CONNECT $FQDN sudo test -f /root/.ssh/id_rsa; then
+    if ! $HYDRA_CONNECT $FQDN sudo test -f /root/.borg/hydra/key; then
       hydra $HYDRA import-keys localhost
     fi
   fi