cp $YAML $HYDRA_FOLDER/puppet/hiera/node/$NODE.$DOMAIN.yaml
# Setup secret YAML template
-mkdir $HYDRA_FOLDER/puppet/hiera/secrets/node
+mkdir -p $HYDRA_FOLDER/puppet/hiera/secrets/node
echo "---" > $HYDRA_FOLDER/puppet/hiera/secrets/node/$NODE.$DOMAIN.yaml
# Copy node template
# Add to git
(
cd $HYDRA_FOLDER/puppet
- git add manifests/site.pp manifests/nodes/$NODE.pp hiera/node/$NODE.$DOMAIN.yaml
- git add manifests/site.pp manifests/nodes/$NODE.pp hiera/secrets/node/$NODE.$DOMAIN.yaml
+ git add manifests/nodes/$NODE.pp hiera/node/$NODE.$DOMAIN.yaml hiera/secrets/node/$NODE.$DOMAIN.yaml
+
+ if [ -e 'manifests/site.pp' ]; then
+ git add manifests/site.pp
+ fi
)