aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-09-25 20:30:27 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-09-25 20:30:27 -0300
commit6542f3827dc1d675a2b129622b6b089a693ac0ca (patch)
tree611a87c4c8e63f921f06c36e93735b25817b7c44 /share
parentd33c4fa00732dc024dc7f28a986891507c544e3f (diff)
downloadhydra-6542f3827dc1d675a2b129622b6b089a693ac0ca.tar.gz
hydra-6542f3827dc1d675a2b129622b6b089a693ac0ca.tar.bz2
Deploy: secrets folder
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydra/deploy7
-rwxr-xr-xshare/hydractl/deploy11
2 files changed, 10 insertions, 8 deletions
diff --git a/share/hydra/deploy b/share/hydra/deploy
index 6b91480..940c17b 100755
--- a/share/hydra/deploy
+++ b/share/hydra/deploy
@@ -39,7 +39,7 @@ for node in $NODES; do
# Sync repository to server
# Exclude eventual keys and version control files
- rsync -CrltDv --no-perms --exclude=keys --exclude=hiera --delete --rsync-path "sudo rsync" $HYDRA_FOLDER/puppet/ $node:/etc/puppet/
+ rsync -CrltDv --no-perms --exclude=keys --exclude=hiera/secrets --delete --rsync-path "sudo rsync" $HYDRA_FOLDER/puppet/ $node:/etc/puppet/
# Setup custom facts
FQDN="`$HYDRA_CONNECT $node facter fqdn`"
@@ -54,7 +54,10 @@ for node in $NODES; do
fi
# Copy needed hiera YAMLs
- # TODO
+ $HYDRA_CONNECT $node sudo mkdir -p $FOLDER/etc/puppet/secrets/{domain,location,node,role}
+ $HYDRA_CONNECT $node sudo cp $HYDRA_FOLDER/puppet/hiera/secrets/domain/$DOMAIN.yaml $FOLDER/etc/puppet/hiera/domain/
+ $HYDRA_CONNECT $node sudo cp $HYDRA_FOLDER/puppet/hiera/secrets/location/$LOCATION.yaml $FOLDER/etc/puppet/hiera/location/
+ $HYDRA_CONNECT $node sudo cp $HYDRA_FOLDER/puppet/hiera/secrets/location/$ROLE.yaml $FOLDER/etc/puppet/hiera/role/
# Run puppet
$HYDRA_CONNECT $node <<EOF
diff --git a/share/hydractl/deploy b/share/hydractl/deploy
index 3e6c7d2..9c82ddf 100755
--- a/share/hydractl/deploy
+++ b/share/hydractl/deploy
@@ -51,7 +51,7 @@ if [ ! -z "$FOLDER" ]; then
# Sync repository to server
# Exclude eventual keys and version control files
- $sudo rsync -CrltDv --no-perms --exclude=keys --exclude=hiera --delete $HYDRA_FOLDER/puppet/ $FOLDER/etc/puppet/
+ $sudo rsync -CrltDv --no-perms --exclude=keys --exclude=hiera/secrets --delete $HYDRA_FOLDER/puppet/ $FOLDER/etc/puppet/
# Setup custom facts
DOMAIN="`echo $FQDN | cut -d . -f 2-`"
@@ -59,11 +59,10 @@ if [ ! -z "$FOLDER" ]; then
LOCATION="`grep "^nodo::location: " domain/$DOMAIN/$FQDN.yaml | cut -d ' ' -f 2 | sed -e "s/'//g" -e 's/"//g'`"
# Copy needed hiera YAMLs
- $sudo mkdir -p $FOLDER/etc/puppet/{domain,location,node,role,virtual}
- $sudo cp $HYDRA_FOLDER/puppet/hiera/domain/$DOMAIN.yaml $FOLDER/etc/puppet/hiera/domain/
- $sudo cp $HYDRA_FOLDER/puppet/hiera/location/$LOCATION.yaml $FOLDER/etc/puppet/hiera/location/
- $sudo cp $HYDRA_FOLDER/puppet/hiera/location/$ROLE.yaml $FOLDER/etc/puppet/hiera/role/
- $sudo rsync -av --delete $HYDRA_FOLDER/puppet/hiera/virtual/ $FOLDER/etc/puppet/hiera/virtual/
+ $sudo mkdir -p $FOLDER/etc/puppet/secrets/{domain,location,node,role}
+ $sudo cp $HYDRA_FOLDER/puppet/hiera/secrets/domain/$DOMAIN.yaml $FOLDER/etc/puppet/hiera/domain/
+ $sudo cp $HYDRA_FOLDER/puppet/hiera/secrets/location/$LOCATION.yaml $FOLDER/etc/puppet/hiera/location/
+ $sudo cp $HYDRA_FOLDER/puppet/hiera/secrets/location/$ROLE.yaml $FOLDER/etc/puppet/hiera/role/
# Check for manifest
if [ ! -e "$HYDRA_FOLDER/puppet/manifests/nodes/$FQDN.pp" ]; then