diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-06-24 12:56:03 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-06-24 12:56:03 -0300 |
commit | e30a586d269c3f1b90d04b5c73d0a3407bf22291 (patch) | |
tree | 707bdea1b8f142ff03c55d88d9c92a2ad59f5406 | |
parent | 22a5da3bb6931d28ad47acb52ff28e0246e3364a (diff) | |
download | hydra-e30a586d269c3f1b90d04b5c73d0a3407bf22291.tar.gz hydra-e30a586d269c3f1b90d04b5c73d0a3407bf22291.tar.bz2 |
Deploy: error handling
-rw-r--r-- | doc/todo.rst | 1 | ||||
-rw-r--r-- | lib/hydra/deploy | 12 | ||||
-rwxr-xr-x | share/hydra/deploy | 8 |
3 files changed, 19 insertions, 2 deletions
diff --git a/doc/todo.rst b/doc/todo.rst index 9c579a9..538592b 100644 --- a/doc/todo.rst +++ b/doc/todo.rst @@ -5,5 +5,4 @@ TODO - metrics and alarms subsystem. - deploy: - lockfile. - - error handling. - log applied version and date (in the node and in the repo). diff --git a/lib/hydra/deploy b/lib/hydra/deploy index 333f183..84e31a2 100644 --- a/lib/hydra/deploy +++ b/lib/hydra/deploy @@ -204,6 +204,12 @@ function hydra_deploy_copy { $SUDO cp $orig $dest elif [ "$location" == "remote" ]; then $DEPLOY_RSYNC "$RSYNC_PATH" $orig $dest + + # Check result + if [ "$?" != "0" ]; then + echo "Error copying data to $FQDN." + exit 1 + fi fi } @@ -215,5 +221,11 @@ function hydra_deploy_facts_collect { $SUDO facter --yaml > $HYDRA_FOLDER/puppet/config/facts/$FQDN.yaml elif [ "$1" == "remote" ]; then $HYDRA_CONNECT $FQDN sudo facter --yaml > $HYDRA_FOLDER/puppet/config/facts/$FQDN.yaml + + # Check result + if [ "$?" != "0" ]; then + echo "Error retrieving facts from $FQDN." + exit 1 + fi fi } diff --git a/share/hydra/deploy b/share/hydra/deploy index f491e70..e55e545 100755 --- a/share/hydra/deploy +++ b/share/hydra/deploy @@ -102,7 +102,7 @@ for node in $NODES; do hydra_deploy_setup remote $node # Check if puppet is installed - $HYDRA_CONNECT $node <<EOF + $HYDRA_CONNECT $FQDN <<EOF ##### BEGIN REMOTE SCRIPT ##### if ! which puppet &> /dev/null; then echo "Installing dependencies..." @@ -112,6 +112,12 @@ for node in $NODES; do ##### END REMOTE SCRIPT ####### EOF + # Check connection + if [ "$?" != "0" ]; then + echo "Error connecting or setting up $FQDN." + exit 1 + fi + # Create folders hydra_deploy_mkdirs |