summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-06-24 12:36:59 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-06-24 12:36:59 -0300
commitf640a7c815f15f5105670c897edf7f020cdc535f (patch)
tree2af64f343ea5b2936f1ad1c699871f3eb0527396
parent8c5dbc6258cfee9685eccc391ed505d9e8d5eca1 (diff)
downloadhydra-f640a7c815f15f5105670c897edf7f020cdc535f.tar.gz
hydra-f640a7c815f15f5105670c897edf7f020cdc535f.tar.bz2
Deploy: fqdn match via local config lookup
-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"