summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydra/newnode15
1 files changed, 10 insertions, 5 deletions
diff --git a/share/hydra/newnode b/share/hydra/newnode
index 7cb7ae4..16ca402 100755
--- a/share/hydra/newnode
+++ b/share/hydra/newnode
@@ -61,19 +61,24 @@ else
fi
# Copy YAML template
-mkdir -p $HYDRA_FOLDER/puppet/hiera/production/domain/$DOMAIN/node
-cp $YAML $HYDRA_FOLDER/puppet/hiera/production/domain/$DOMAIN/node/$NODE.$DOMAIN.yaml
+mkdir -p $HYDRA_FOLDER/puppet/hiera/node
+cp $YAML $HYDRA_FOLDER/puppet/hiera/node/$NODE.$DOMAIN.yaml
+
+# Setup secret YAML template
+mkdir $HYDRA_FOLDER/puppet/hiera/secrets/node
+echo "---" > $HYDRA_FOLDER/puppet/hiera/secrets/node/$NODE.$DOMAIN.yaml
# Copy node template
mkdir -p $HYDRA_FOLDER/puppet/manifests/nodes
cp $PP $HYDRA_FOLDER/puppet/manifests/nodes/$NODE.$DOMAIN.pp
# Edit the template
-sed -i -e "s/nodename/$NODE/g" $HYDRA_FOLDER/puppet/manifests/nodes/$NODE.pp
-sed -i -e "s/example.org/$DOMAIN/g" $HYDRA_FOLDER/puppet/manifests/nodes/$NODE.pp
+sed -i -e "s/nodename/$NODE/g" $HYDRA_FOLDER/puppet/manifests/nodes/$NODE.$DOMAIN.pp
+sed -i -e "s/example.org/$DOMAIN/g" $HYDRA_FOLDER/puppet/manifests/nodes/$NODE.$DOMAIN.pp
# Add to git
(
cd $HYDRA_FOLDER/puppet
- git add manifests/site.pp manifests/nodes/$NODE.pp hiera/production/domain/$DOMAIN/node/$NODE.$DOMAIN.yaml
+ 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
)