diff options
-rw-r--r-- | doc/todo.rst | 1 | ||||
-rwxr-xr-x | share/hydra/deploy | 15 |
2 files changed, 15 insertions, 1 deletions
diff --git a/doc/todo.rst b/doc/todo.rst index 999ecb0..64b4b63 100644 --- a/doc/todo.rst +++ b/doc/todo.rst @@ -6,7 +6,6 @@ TODO - lockfile. - one-step ssh+sudo deployment. - simple deployer using just rsync. - - check for sudo config at the remote site. - compile: - per-node compiled files (node/nodename.yaml and secrets/node/nodename.yaml). - backups: automatic definitions for per-node backup::users. diff --git a/share/hydra/deploy b/share/hydra/deploy index 3cec85f..8c45828 100755 --- a/share/hydra/deploy +++ b/share/hydra/deploy @@ -51,6 +51,11 @@ for node in $NODES; do FOLDER=$node hydra_deploy_setup folder $FOLDER || continue + if ! sudo -n true; then + echo "Please set passwordless sudo on localhost." + continue + fi + # Check if puppet is installed if [ ! -e "$FOLDER/usr/bin/puppet" ]; then echo "Installing dependencies..." @@ -78,6 +83,11 @@ for node in $NODES; do elif [ "$node" == "localhost" ] || [ "$node" == "`facter fqdn`" ] || [ "$node" == "`facter hostname`" ]; then echo "Deploying to localhost..." + if ! sudo -n true; then + echo "Please set passwordless sudo on localhost." + continue + fi + # Setup deploy environment hydra_deploy_setup || continue @@ -106,6 +116,11 @@ for node in $NODES; do # Check if puppet is installed $HYDRA_CONNECT $FQDN <<EOF ##### BEGIN REMOTE SCRIPT ##### + if ! sudo -n true; then + echo "Please set passwordless sudo on $FQDN." + exit 1 + fi + if ! which puppet &> /dev/null; then echo "Installing dependencies..." sudo apt-get update |