From 20ea6107fae457a76466250871bc11c89af04843 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 19 Oct 2015 17:48:03 -0200 Subject: Newnode: do not require nodes.pp --- share/hydra/newnode | 10 +++++----- 1 file 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 -- cgit v1.2.3