summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-10-19 17:52:55 -0200
committerSilvio Rhatto <rhatto@riseup.net>2015-10-19 17:52:55 -0200
commitc48c4abab75794f6e1b91e841bfd9736e1c189a8 (patch)
tree1a81ee35908209a4f14b85ac2ad13c2575a1c13d
parent20ea6107fae457a76466250871bc11c89af04843 (diff)
downloadhydra-c48c4abab75794f6e1b91e841bfd9736e1c189a8.tar.gz
hydra-c48c4abab75794f6e1b91e841bfd9736e1c189a8.tar.bz2
Newnode: do not require site.pp
-rwxr-xr-xshare/hydra/newnode9
1 files changed, 6 insertions, 3 deletions
diff --git a/share/hydra/newnode b/share/hydra/newnode
index 5fdd264..b375b8a 100755
--- a/share/hydra/newnode
+++ b/share/hydra/newnode
@@ -65,7 +65,7 @@ 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
+mkdir -p $HYDRA_FOLDER/puppet/hiera/secrets/node
echo "---" > $HYDRA_FOLDER/puppet/hiera/secrets/node/$NODE.$DOMAIN.yaml
# Copy node template
@@ -79,6 +79,9 @@ sed -i -e "s/example.org/$DOMAIN/g" $HYDRA_FOLDER/puppet/manifests/nodes/$NODE.$
# 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
)