summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO.md1
-rwxr-xr-xshare/hydra/provision16
2 files changed, 13 insertions, 4 deletions
diff --git a/TODO.md b/TODO.md
index 0cfa808..57dda22 100644
--- 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).
diff --git a/share/hydra/provision b/share/hydra/provision
index 862e0e1..fc67109 100755
--- a/share/hydra/provision
+++ b/share/hydra/provision
@@ -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