aboutsummaryrefslogtreecommitdiff
path: root/share/hydra/nodes
blob: c7e4c4cb78c8c0f8cde8a37624b55bf9159e143b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
#
# 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/*