aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-10-19 17:48:03 -0200
committerSilvio Rhatto <rhatto@riseup.net>2015-10-19 17:48:03 -0200
commit20ea6107fae457a76466250871bc11c89af04843 (patch)
treef12fd5236f1213e6e1eeb4827701473d734e2f6a /share
parent0fd521dde2727bd83cb20e37386f411f813ae69d (diff)
downloadhydra-20ea6107fae457a76466250871bc11c89af04843.tar.gz
hydra-20ea6107fae457a76466250871bc11c89af04843.tar.bz2
Newnode: do not require nodes.pp
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydra/newnode10
1 files changed, 5 insertions, 5 deletions
diff --git a/share/hydra/newnode b/share/hydra/newnode
index 16ca402..5fdd264 100755
--- a/share/hydra/newnode
+++ b/share/hydra/newnode
@@ -32,10 +32,8 @@ if [ -z "$NODE" ]; then
elif [ ! -e "$HYDRA_FOLDER/config/domain" ]; then
echo "fatal: please configure your domain at $HYDRA_FOLDER/config/domain"
exit 1
-elif [ ! -f "$NODES" ]; then
- echo "fatal: $NODES not found"
- exit 1
-elif grep -qe "^import \"nodes/$NODE.pp\"$" $NODES &> /dev/null; then
+#elif grep -qe "^import \"nodes/$NODE.pp\"$" $NODES &> /dev/null; then
+elif [ -e "$HYDRA_FOLDER/puppet/manifest/nodes/$NODE.pp" ]; then
echo "fatal: node $NODE already defined"
exit 1
fi
@@ -44,7 +42,9 @@ fi
DOMAIN="`cat $HYDRA_FOLDER/config/domain`"
# Create node
-echo "import \"nodes/$NODE.$DOMAIN.pp\"" >> $NODES
+if [ -e "$NODES" ]; then
+ echo "import \"nodes/$NODE.$DOMAIN.pp\"" >> $NODES
+fi
# Set YAML template
if [ -e "$HYDRA_FOLDER/config/templates/node/nodo.example.org.yaml" ]; then