diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-06-24 12:36:59 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-06-24 12:36:59 -0300 |
commit | f640a7c815f15f5105670c897edf7f020cdc535f (patch) | |
tree | 2af64f343ea5b2936f1ad1c699871f3eb0527396 /lib | |
parent | 8c5dbc6258cfee9685eccc391ed505d9e8d5eca1 (diff) | |
download | hydra-f640a7c815f15f5105670c897edf7f020cdc535f.tar.gz hydra-f640a7c815f15f5105670c897edf7f020cdc535f.tar.bz2 |
Deploy: fqdn match via local config lookup
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hydra/deploy | 9 |
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" |