]> gitweb.fluxo.info Git - hydra.git/commitdiff
Newnode: additional checks for puppet an ansible folders
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 3 Oct 2019 19:11:34 +0000 (16:11 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 3 Oct 2019 19:11:34 +0000 (16:11 -0300)
share/hydra/newnode

index 3e32d8a7ed2fa9094115d9bc619ab0a9431cd284..299e2aefa966f57ee4ae9ba48412c5c1a9d02a1a 100755 (executable)
@@ -93,14 +93,18 @@ fi
 
 # Add to git
 (
-  cd $HYDRA_FOLDER/puppet
-  #git add manifests/nodes/$NODE.pp config/node/$NODE.yaml config/secrets/node/$NODE.yaml
-  git add config/node/$NODE.yaml config/secrets/node/$NODE.yaml
+  if [ -e "$HYDRA_FOLDER/puppet" ]; then
+    cd $HYDRA_FOLDER/puppet
+    #git add manifests/nodes/$NODE.pp config/node/$NODE.yaml config/secrets/node/$NODE.yaml
+    git add config/node/$NODE.yaml config/secrets/node/$NODE.yaml
 
-  #if [ -e 'manifests/site.pp' ]; then
-  #  git add manifests/site.pp
-  #fi
+    #if [ -e 'manifests/site.pp' ]; then
+    #  git add manifests/site.pp
+    #fi
+  fi
 
-  cd $HYDRA_FOLDER/ansible
-  git add .
+  if [ -e "$HYDRA_FOLDER/ansible" ]; then
+    cd $HYDRA_FOLDER/ansible
+    git add .
+  fi
 )