diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2015-09-26 22:27:25 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2015-09-26 22:27:25 -0300 |
commit | 4952dcb2c77f5f99039283cfaaf127553c8e7c3d (patch) | |
tree | 92546c8bfee771107343adcc538da63dbb916ada /lib | |
parent | d876a2fa81899eb2bc689a0ac9d0ecd9513cf187 (diff) | |
download | hydra-4952dcb2c77f5f99039283cfaaf127553c8e7c3d.tar.gz hydra-4952dcb2c77f5f99039283cfaaf127553c8e7c3d.tar.bz2 |
Updates deployment code
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hydra/deploy | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/hydra/deploy b/lib/hydra/deploy index f537c42..d5df1a0 100644 --- a/lib/hydra/deploy +++ b/lib/hydra/deploy @@ -1,7 +1,6 @@ #!/bin/bash # Setup deployment parameters -# TODO: check environment passing to sudo, chroot and ssh function hydra_deploy_setup { # Common parameters # Exclude eventual keys and version control files @@ -56,8 +55,7 @@ function hydra_deploy_setup { DOMAIN="`echo $FQDN | cut -d . -f 2-`" ROLE="`hydra_yaml_param nodo::role $HYDRA_FOLDER/$DOMAIN/$FQDN.yaml`" LOCATION="`hydra_yaml_param nodo::location $HYDRA_FOLDER/$DOMAIN/$FQDN.yaml`" - DEPLOY_ENV="LC_ALL=C FACTER_role=$ROLE FACTER_location=$LOCATION" - DEPLOY_PUPPET="$DEPLOY_ENV puppet appy $PUPPET_OPTS $PUPPET_MANIFEST" + DEPLOY_PUPPET="puppet appy $PUPPET_OPTS $PUPPET_MANIFEST" DEPLOY_APPLY="$DEPLOY_COMMAND $DEPLOY_PUPPET" # Check for manifest @@ -91,11 +89,15 @@ function hydra_hiera_copy { $DEPLOY_COPY $HYDRA_FOLDER/puppet/hiera/secrets/domain/$DOMAIN.yaml $DEPLOY_DEST/etc/puppet/hiera/secrets/domain/ fi - if [ ! -z "$LOCATION" ] && [ -e "$HYDRA_FOLDER/puppet/hiera/secrets/domain/$LOCATION.yaml" ]; then + if [ ! -z "$LOCATION" ] && [ -e "$HYDRA_FOLDER/puppet/hiera/secrets/location/$LOCATION.yaml" ]; then $DEPLOY_COPY $HYDRA_FOLDER/puppet/hiera/secrets/location/$LOCATION.yaml $DEPLOY_DEST/etc/puppet/hiera/secrets/location/ fi - if [ ! -z "$ROLE" ] && [ -e "$HYDRA_FOLDER/puppet/hiera/secrets/domain/$ROLE.yaml" ]; then - $DEPLOY_COPY $HYDRA_FOLDER/puppet/hiera/secrets/location/$ROLE.yaml $DEPLOY_DEST/etc/puppet/hiera/secrets/role/ + if [ ! -z "$ROLE" ] && [ -e "$HYDRA_FOLDER/puppet/hiera/secrets/role/$ROLE.yaml" ]; then + $DEPLOY_COPY $HYDRA_FOLDER/puppet/hiera/secrets/role/$ROLE.yaml $DEPLOY_DEST/etc/puppet/hiera/secrets/role/ + fi + + if [ ! -z "$NODE" ] && [ -e "$HYDRA_FOLDER/puppet/hiera/secrets/node/$NODE.yaml" ]; then + $DEPLOY_COPY $HYDRA_FOLDER/puppet/hiera/secrets/node/$NODE.yaml $DEPLOY_DEST/etc/puppet/hiera/secrets/node/ fi } |