From 5efc7799d6fa7cd9122075e350f48292469dfcea Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 20 Oct 2015 17:03:32 -0200 Subject: Deploy: install packages first --- share/hydra/deploy | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'share') 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 < /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 -- cgit v1.2.3