diff options
Diffstat (limited to 'share')
-rwxr-xr-x | share/hydra/deploy | 33 |
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 |