aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/todo.rst1
-rw-r--r--lib/hydra/misc2
-rwxr-xr-xshare/hydra/eyaml5
-rwxr-xr-xshare/hydra/mass6
-rwxr-xr-xshare/hydra/newkeys3
-rwxr-xr-xshare/hydra/sync2
6 files changed, 7 insertions, 12 deletions
diff --git a/doc/todo.rst b/doc/todo.rst
index 6e66e48..3a80f24 100644
--- a/doc/todo.rst
+++ b/doc/todo.rst
@@ -1,7 +1,6 @@
TODO
====
-- auto install dependencies (hiera-eyaml, keyringer, etc).
- docs.
- deploy:
- lockfile.
diff --git a/lib/hydra/misc b/lib/hydra/misc
index 894502d..0105760 100644
--- a/lib/hydra/misc
+++ b/lib/hydra/misc
@@ -66,7 +66,7 @@ function hydra_install_package {
if [ "$?" == "1" ]; then
echo "Installing package $1..."
- DEBIAN_FRONTEND=noninteractive apt-get install $1 -y
+ DEBIAN_FRONTEND=noninteractive $SUDO apt-get install $1 -y || exit 1
fi
}
diff --git a/share/hydra/eyaml b/share/hydra/eyaml
index 24e714d..b07d991 100755
--- a/share/hydra/eyaml
+++ b/share/hydra/eyaml
@@ -29,10 +29,7 @@ DOMAIN="`echo $FQDN | cut -d . -f 2-`"
shift
# Check for eyaml
-if ! which eyaml &> /dev/null; then
- echo "Please install ruby-eyaml"
- exit 1
-fi
+hydra_install_package hiera-eyaml
# Check for node
if [ -z "$NODE" ]; then
diff --git a/share/hydra/mass b/share/hydra/mass
index a716bae..ba5bddd 100755
--- a/share/hydra/mass
+++ b/share/hydra/mass
@@ -18,7 +18,7 @@
# Issue commands with pssh
function mass_pssh {
- hydra_check_command parallel-ssh
+ hydra_install_package pssh
parallel-ssh -P -p 4 -t 0 -h $TMPWORK sudo $COMMAND
}
@@ -32,13 +32,13 @@ function mass_loop {
# Issue commands with dish
function mass_dish {
- hydra_check_command dish
+ hydra_install_package dish
dish -f -p /dev/null -e "sudo $COMMAND" -g $TMPWORK
}
# Issue commands with mussh
function mass_mussh {
- hydra_check_command mussh
+ hydra_install_package mussh
mussh -H $TMPWORK -c "sudo $COMMAND"
}
diff --git a/share/hydra/newkeys b/share/hydra/newkeys
index 84180ba..31e5ee4 100755
--- a/share/hydra/newkeys
+++ b/share/hydra/newkeys
@@ -88,8 +88,7 @@ hydra_config_load
# Check for keyringer.
if ! which keyringer &> /dev/null; then
- echo "Error: please install keyringer."
- exit 1
+ hydra_install_package keyringer
fi
hydra_newkeys $*
diff --git a/share/hydra/sync b/share/hydra/sync
index f062c98..3727c8e 100755
--- a/share/hydra/sync
+++ b/share/hydra/sync
@@ -83,7 +83,7 @@ hydra_sync $REPOSITORIES
# Update keyring.
if [ "$UPDATE_KEYRINGER" != "no" ]; then
if ! which keyringer &> /dev/null; then
- echo "Please install keyringer for a full hydra experience."
+ hydra_install_package keyringer
elif [ ! -e "$HOME/.keyringer/$HYDRA" ]; then
echo "Initializing keyring for $HYDRA..."
keyringer $HYDRA init $HYDRA_FOLDER/$repository