Created
July 18, 2014 18:47
-
-
Save awaxa/beb8d68405bb696628b6 to your computer and use it in GitHub Desktop.
using an array of hashes from hiera in a template with puppet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
sockets: | |
- id: 'one' | |
address: '127.0.0.1' | |
port: '8001' | |
- id: 'two' | |
address: '127.0.0.2' | |
port: '8002' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sockets = hiera('sockets') | |
notice(inline_template(" | |
<% @sockets.each do |socket| -%> | |
id=<%= socket['id'] %> | |
address=<%= socket['address'] %> | |
port=<%= socket['port'] %> | |
<% end -%> | |
")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment