summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-09-21 12:48:55 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-09-21 12:48:55 -0300
commite81b332b0bc6e11cae63372a0418830939655c2b (patch)
tree6017bda444139e2516f9b3baedc1e99bfe666bd5
parenta7ca30e854f845f670c852a2edd5ef13656c774f (diff)
downloadhydra-e81b332b0bc6e11cae63372a0418830939655c2b.tar.gz
hydra-e81b332b0bc6e11cae63372a0418830939655c2b.tar.bz2
Check for sudo config at the remote site
-rw-r--r--doc/todo.rst1
-rwxr-xr-xshare/hydra/deploy15
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