aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/todo.rst2
-rw-r--r--lib/hydra/deploy9
2 files changed, 9 insertions, 2 deletions
diff --git a/doc/todo.rst b/doc/todo.rst
index cce95e9..67f4d66 100644
--- a/doc/todo.rst
+++ b/doc/todo.rst
@@ -5,6 +5,6 @@ TODO
- metrics and alarms subsystem.
- deploy:
- lockfile.
- - fqdn match via local config lookup.
+ - error handling.
- check hostname and required node configuration.
- log applied version and date (in the node and in the repo).
diff --git a/lib/hydra/deploy b/lib/hydra/deploy
index 87cc8cf..ceacc3e 100644
--- a/lib/hydra/deploy
+++ b/lib/hydra/deploy
@@ -22,9 +22,16 @@ function hydra_deploy_setup {
# Deploy in a remote host
if [ ! -z "$2" ]; then
NODE="$2"
+ FQDN="$(basename `find $HYDRA_FOLDER/puppet/config/node/ -name $NODE'.*' | head -n 1` .yaml)"
+
+ # Check for config/node name
+ if [ -z "$FQDN" ]; then
+ echo "Cannot find config for $NODE."
+ exit 1
+ fi
+
DEPLOY_BASE="/etc"
DEPLOY_COMMAND="$HYDRA_CONNECT $NODE sudo"
- FQDN="`$DEPLOY_COMMAND cat /etc/hostname`"
DEPLOY_OPTS="$HYDRA_FOLDER/puppet/ $NODE:/etc/puppet/"
DEPLOY_DEST="$FQDN:"
RSYNC_PATH="sudo rsync -q"