aboutsummaryrefslogtreecommitdiff
path: root/share/hydra/nodes
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-03-05 22:58:54 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-03-05 22:58:54 -0300
commit17dee411a4e39dc17ae578cd20390c262874d150 (patch)
tree7dec65d9dab773354383071ee7f8881f6be5b9f7 /share/hydra/nodes
parent8da3abd3a203aad48b63908fed4fad08fd32b6ca (diff)
downloadhydra-17dee411a4e39dc17ae578cd20390c262874d150.tar.gz
hydra-17dee411a4e39dc17ae578cd20390c262874d150.tar.bz2
Get node list via hiera files
Diffstat (limited to 'share/hydra/nodes')
-rwxr-xr-xshare/hydra/nodes13
1 files changed, 11 insertions, 2 deletions
diff --git a/share/hydra/nodes b/share/hydra/nodes
index b070680..4ddf916 100755
--- a/share/hydra/nodes
+++ b/share/hydra/nodes
@@ -18,13 +18,22 @@
# Get a list of puppet node files
function hydra_node_files {
- if [ -d "$PUPPET/manifests/nodes/" ]; then
+ if [ -d "$PUPPET/hiera/node/" ]; then
+ FILES="$PUPPET/hiera/node/*"
+ elif [ -d "$PUPPET/manifests/nodes/" ]; then
FILES="$PUPPET/manifests/nodes/*"
else
FILES="`find $PUPPET -name 'nodes.pp'`"
fi
}
+# Get using the filename
+function hydra_node_names {
+ for file in $FILES; do
+ basename $file .yaml
+ done
+}
+
# Get all lines matching a node definition
function hydra_node_lines {
# See http://www.mail-archive.com/puppet-users@googlegroups.com/msg01615.html
@@ -33,7 +42,7 @@ function hydra_node_lines {
# Default node retrieval method
function hydra_nodes {
- hydra_node_lines | cut -d "'" -f2
+ hydra_node_names
}
# Load