aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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