aboutsummaryrefslogtreecommitdiff
path: root/share/hydractl
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-09-26 22:27:25 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-09-26 22:27:25 -0300
commit4952dcb2c77f5f99039283cfaaf127553c8e7c3d (patch)
tree92546c8bfee771107343adcc538da63dbb916ada /share/hydractl
parentd876a2fa81899eb2bc689a0ac9d0ecd9513cf187 (diff)
downloadhydra-4952dcb2c77f5f99039283cfaaf127553c8e7c3d.tar.gz
hydra-4952dcb2c77f5f99039283cfaaf127553c8e7c3d.tar.bz2
Updates deployment code
Diffstat (limited to 'share/hydractl')
-rwxr-xr-xshare/hydractl/deploy19
1 files changed, 10 insertions, 9 deletions
diff --git a/share/hydractl/deploy b/share/hydractl/deploy
index b488698..191b060 100755
--- a/share/hydractl/deploy
+++ b/share/hydractl/deploy
@@ -23,12 +23,6 @@ hydra_config_load
# Parameters
FOLDER="$1"
-# Set sudo config
-local sudo device rsync
-if [ "`whoami`" != 'root' ]; then
- sudo="sudo"
-fi
-
# Dispatch
if [ ! -z "$FOLDER" ]; then
echo "Deploying to $FOLDER..."
@@ -43,15 +37,22 @@ if [ ! -z "$FOLDER" ]; then
# Copy hiera configuration
hydra_hiera_copy
- # Run puppet
- $DEPLOY_APPLY
+ # Check if puppet is installed
+ if [ ! -e "$FOLDER/usr/bin/puppet" ]; then
+ $DEPLOY_COMMAND apt-get install puppet -y
+ fi
+
+ # Run puppet, overriding FQDN
+ FACTER_domain=$DOMAIN FACTER_hostname=$HOSTNAME FACTER_fqdn=$HOSTNAME.$DOMAIN $DEPLOY_APPLY
elif [ -e "$HYDRA_FOLDER/puppet/manifests/nodes/$FQDN.pp" ]; then
echo "Deploying to localhost..."
# Setup deploy environment
hydra_deploy_setup
- # TODO: override FQDN and DOMAIN
+ # Check if puppet is installed
+ hydra_install_package puppet
+
# Run puppet
$DEPLOY_APPLY
fi