summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-10-02 15:40:20 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-10-02 15:40:20 -0300
commitb7dcb1553e2ce91bdaf51c427b7bfd332f97b611 (patch)
tree3fb81b75ee861d9e87d51982d8c880ef512baf08
parentfdb07b542860089eb208ec5967826a2225899d10 (diff)
downloadhydra-b7dcb1553e2ce91bdaf51c427b7bfd332f97b611.tar.gz
hydra-b7dcb1553e2ce91bdaf51c427b7bfd332f97b611.tar.bz2
Newnode: provision support
-rwxr-xr-xshare/hydra/newnode11
1 files changed, 9 insertions, 2 deletions
diff --git a/share/hydra/newnode b/share/hydra/newnode
index b656930..cfd521c 100755
--- a/share/hydra/newnode
+++ b/share/hydra/newnode
@@ -23,8 +23,8 @@ hydra_config_load
# Parameters
BASENAME="`basename $0`"
NODE="$1"
+CLASS="$2"
DOMAIN="`cat $HYDRA_FOLDER/config/domain 2> /dev/null`"
-#NODES="$HYDRA_FOLDER/puppet/manifests/site.pp"
# Check if node was given by fqdn or just hostname
if ! echo $NODE | grep -q '\.'; then
@@ -33,7 +33,7 @@ fi
# Check configuration and parameters
if [ -z "$NODE" ]; then
- echo "usage: hydra $BASENAME <node>"
+ echo "usage: hydra $BASENAME <node> [class]"
exit 1
elif [ ! -e "$HYDRA_FOLDER/config/domain" ]; then
echo "fatal: please configure your domain at $HYDRA_FOLDER/config/domain"
@@ -43,6 +43,13 @@ elif [ -e "$HYDRA_FOLDER/puppet/config/node/$NODE.yaml" ]; then
exit 1
fi
+# Provision config
+if [ ! -z "$CLASS" ]; then
+ if [ -e "$APP_BASE/share/config/provision/$CLASS.conf" ]; then
+ cp $APP_BASE/share/config/provision/$CLASS.conf $HYDRA_FOLDER/config/provision/$NODE.conf
+ fi
+fi
+
# Set YAML template
if [ -e "$HYDRA_FOLDER/config/puppet/nodo.example.org.yaml" ]; then
YAML="$HYDRA_FOLDER/config/puppet/nodo.example.org.yaml"