]> gitweb.fluxo.info Git - hydra.git/commitdiff
Hydra provision enhancements
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 4 Mar 2014 19:09:09 +0000 (16:09 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 4 Mar 2014 19:09:09 +0000 (16:09 -0300)
TODO.md
share/hydra/provision

diff --git a/TODO.md b/TODO.md
index 0cfa808a7e9201a84deae1e22c29cf53b83c7a29..57dda2229cad74fb79fb2e1e9e3fb08d208a7326 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -4,5 +4,4 @@ TODO
 Hydra
 -----
 
-  - Provision: wrapper for "hydractl provision" with stores/uses node configuration.
   - Bootless: properly support $subdevice in parted or always use first device (like /dev/sdb1).
index 862e0e1c2b2b6070cf1909b247d0a367a62c593f..fc67109be75a35cfdf7098f13942bcf6eeb2492a 100755 (executable)
@@ -22,9 +22,19 @@ hydra_config_load
 
 # Parameters
 NODE="$1"
-CONFIG="$HYDRA_FOLDER/config/provision/$NODE"
+CONFIG="$HYDRA_FOLDER/config/provision"
+
+# Ensure config folder exists
+mkdir -p $CONFIG
+
+# Syntax
+if [ -z "$NODE" ]; then
+  echo "Available configurations:"
+  ( cd $CONFIG && tree )
+  exit 1
+fi
 
 # Provision
-if [ -e "$CONFIG" ]; then
-  hydractl provision $CONFIG
+if [ -e "$CONFIG/$NODE.conf" ]; then
+  hydractl provision $CONFIG/$NODE.conf
 fi