aboutsummaryrefslogtreecommitdiff
path: root/lib
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 /lib
parent8c5dbc6258cfee9685eccc391ed505d9e8d5eca1 (diff)
downloadhydra-f640a7c815f15f5105670c897edf7f020cdc535f.tar.gz
hydra-f640a7c815f15f5105670c897edf7f020cdc535f.tar.bz2
Deploy: fqdn match via local config lookup
Diffstat (limited to 'lib')
-rw-r--r--lib/hydra/deploy9
1 files changed, 8 insertions, 1 deletions
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"