summaryrefslogtreecommitdiff
path: root/share
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
parentd876a2fa81899eb2bc689a0ac9d0ecd9513cf187 (diff)
downloadhydra-4952dcb2c77f5f99039283cfaaf127553c8e7c3d.tar.gz
hydra-4952dcb2c77f5f99039283cfaaf127553c8e7c3d.tar.bz2
Updates deployment code
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydra/deploy11
-rwxr-xr-xshare/hydractl/deploy19
2 files changed, 21 insertions, 9 deletions
diff --git a/share/hydra/deploy b/share/hydra/deploy
index 0afd879..4bf6686 100755
--- a/share/hydra/deploy
+++ b/share/hydra/deploy
@@ -42,6 +42,17 @@ for node in $NODES; do
# Copy hiera configuration
hydra_hiera_copy
+ # Check if puppet is installed
+ $HYDRA_CONNECT $node <<EOF
+ ##### BEGIN REMOTE SCRIPT #####
+ if ! which puppet &> /dev/null; then
+ echo "Installing puppet..."
+ sudo aptitude update
+ sudo aptitude install puppet -y
+ fi
+ ##### END REMOTE SCRIPT #######
+EOF
+
# Run puppet
$DEPLOY_APPLY
done
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