Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: hiera/files/classify.sh

Issue 4810150141493248: Issue 122 - Puppet ENC via Hiera (Closed)
Patch Set: Created Sept. 8, 2014, 11:56 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: hiera/files/classify.sh
diff --git a/hiera/files/classify.sh b/hiera/files/classify.sh
new file mode 100755
index 0000000000000000000000000000000000000000..4d3b34f6d842fb4cb497f5233ea017c53762be50
--- /dev/null
+++ b/hiera/files/classify.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+HOSTNAME=`echo "$@" | sed 's/\..*$//'`
+( echo -n 'classes = '; hiera classes ::hostname=$HOSTNAME
+ echo -n 'parameters = '; hiera parameters ::hostname=$HOSTNAME
+ echo 'data = {"classes"=>classes, "parameters"=>parameters}'
+ echo 'print data.to_yaml' ) \
+| ruby -ryaml
Wladimir Palant 2014/09/09 18:15:06 Wow, that's quite a hack... Why use a shell scrip
mathias 2014/10/08 03:02:33 Of course it's to be converted - this one here was
+

Powered by Google App Engine
This is Rietveld