# 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`"
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
# 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-`"
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