From db50450364de13c718defa6eff8b0623840f6480 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 23 May 2018 17:51:37 -0300 Subject: Deploy: test both OpenSSH and Borg keys --- share/hydra/deploy | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/share/hydra/deploy b/share/hydra/deploy index 9736c1d..b988e43 100755 --- a/share/hydra/deploy +++ b/share/hydra/deploy @@ -89,8 +89,7 @@ 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/.borg/hydra/key; then + if ! $SUDO test -f $FOLDER/root/.ssh/id_rsa || ! $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 @@ -129,8 +128,7 @@ 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/.borg/hydra/key; then + if ! $SUDO test -f /root/.ssh/id_rsa || ! $SUDO test -f /root/.borg/hydra/key; then hydra $HYDRA import-keys localhost fi else @@ -213,8 +211,7 @@ 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/.borg/hydra/key; then + if ! $HYDRA_CONNECT $FQDN sudo test -f /root/.ssh/id_rsa || ! $HYDRA_CONNECT $FQDN sudo test -f /root/.borg/hydra/key; then hydra $HYDRA import-keys localhost fi fi -- cgit v1.2.3