diff options
-rwxr-xr-x | share/hydra/deploy | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/share/hydra/deploy b/share/hydra/deploy index d8fd3f8..d3fc513 100755 --- a/share/hydra/deploy +++ b/share/hydra/deploy @@ -113,11 +113,26 @@ for node in $NODES; do # Setup deploy environment hydra_deploy_setup remote $node || continue + # Check for passwordless connections + # http://stackoverflow.com/questions/3830508/check-if-passwordless-access-has-been-setup#3830680 + if ! $HYDRA_CONNECT -o NumberOfPasswordPrompts=0 $FQDN true; then + echo "Unable to connect to $FQDN via SSH without a password." + echo "Please set a passwordless login for your user at $FQDN using public key auth." + exit 1 + fi + # Check remote environment $HYDRA_CONNECT $FQDN <<EOF ##### BEGIN REMOTE SCRIPT ##### + # Check for passwordless sudo + # See references like https://raymii.org/s/articles/Check_if_passwordless_sudo_can_be_used_in_a_bash_script_or_nagios_check.html if ! sudo -n true; then echo "Please set passwordless sudo on $FQDN." + echo "You can do that by adding the following line on /etc/sudoers.d/local:" + echo "" + echo "%sudo ALL=NOPASSWD: ALL" + echo "" + echo "And make sure your user is included in the 'sudo' group." exit 1 fi |