From 88fb3d2d1bcfdc2cf59ca908b80bc40292aa8ed0 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 13 Nov 2010 12:32:55 -0200 Subject: Initial working version for a node tool and misc changes --- share/hydra/nodes | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'share/hydra/nodes') diff --git a/share/hydra/nodes b/share/hydra/nodes index 93593e1..c7e4c4c 100755 --- a/share/hydra/nodes +++ b/share/hydra/nodes @@ -2,3 +2,24 @@ # # Node tool. # + +# Default node retrieval method +function hydra_get_nodes { + # See http://www.mail-archive.com/puppet-users@googlegroups.com/msg01615.html + grep ^node $* | sed -e 's/^node //' | awk -F, '{for(i=1;i<=NF;i++) {print $i}}' | cut -d "'" -f2 +} + +# Load functions +source $APP_BASE/lib/hydra/functions || exit 1 + +# Load config +hydra_config_load + +# Validation +if [ -z "$PUPPET" ]; then + echo "No PUPPET parameter defined at $HYDRA preferences." + exit 1 +fi + +# Get nodes +hydra_get_nodes $PUPPET/manifests/nodes/* -- cgit v1.2.3