aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-10-20 17:03:32 -0200
committerSilvio Rhatto <rhatto@riseup.net>2015-10-20 17:03:32 -0200
commit5efc7799d6fa7cd9122075e350f48292469dfcea (patch)
tree9b0ea7eb1d29ccdb9e4a5aac7d14ab80b470d26a
parent4f18b095360a9e42145535f79fc0b1eabbd0efed (diff)
downloadhydra-5efc7799d6fa7cd9122075e350f48292469dfcea.tar.gz
hydra-5efc7799d6fa7cd9122075e350f48292469dfcea.tar.bz2
Deploy: install packages first
-rwxr-xr-xshare/hydra/deploy33
1 files changed, 19 insertions, 14 deletions
diff --git a/share/hydra/deploy b/share/hydra/deploy
index 258c68e..2927920 100755
--- a/share/hydra/deploy
+++ b/share/hydra/deploy
@@ -35,6 +35,14 @@ for node in $NODES; do
# Setup deploy environment
hydra_deploy_setup folder $FOLDER
+
+ # Check if puppet is installed
+ if [ ! -e "$FOLDER/usr/bin/puppet" ]; then
+ echo "Installing dependencies..."
+ $DEPLOY_COMMAND apt-get install $DEPLOY_DEPENDENCIES -y
+ fi
+
+ # Create folders
hydra_deploy_mkdirs
# Sync repository to server
@@ -44,11 +52,6 @@ for node in $NODES; do
# Copy hiera configuration
hydra_deploy_copy_secrets folder
- # Check if puppet is installed
- if [ ! -e "$FOLDER/usr/bin/puppet" ]; then
- $DEPLOY_COMMAND apt-get install $DEPLOY_DEPENDENCIES -y
- fi
-
# Run puppet, overriding FQDN
echo "Applying configuration..."
FACTER_domain=$DOMAIN FACTER_hostname=$HOSTNAME FACTER_fqdn=$HOSTNAME.$DOMAIN $DEPLOY_APPLY
@@ -71,26 +74,28 @@ for node in $NODES; do
# Setup deploy environment
hydra_deploy_setup remote $node
- hydra_deploy_mkdirs
-
- # Sync repository to server
- echo "Syncing configuration..."
- $DEPLOY_RSYNC "$RSYNC_PATH" $DEPLOY_OPTS
-
- # Copy hiera configuration
- hydra_deploy_copy_secrets remote
# Check if puppet is installed
$HYDRA_CONNECT $node <<EOF
##### BEGIN REMOTE SCRIPT #####
if ! which puppet &> /dev/null; then
- echo "Installing puppet..."
+ echo "Installing dependencies..."
sudo aptitude update
sudo aptitude install $DEPLOY_DEPENDENCIES -y
fi
##### END REMOTE SCRIPT #######
EOF
+ # Create folders
+ hydra_deploy_mkdirs
+
+ # Sync repository to server
+ echo "Syncing configuration..."
+ $DEPLOY_RSYNC "$RSYNC_PATH" $DEPLOY_OPTS
+
+ # Copy hiera configuration
+ hydra_deploy_copy_secrets remote
+
# Run puppet
echo "Applying configuration..."
$DEPLOY_APPLY