aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/hydra/deploy14
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
}