Created
February 1, 2015 01:32
-
-
Save robinbowes/ad7a0a8afa51b2902228 to your computer and use it in GitHub Desktop.
Puppet templating
This file contains 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
class test{ | |
$domains = { | |
'domain1.tld' => { | |
'detail' => 'foo' | |
}, | |
'domain2.tld' => { | |
'detail' => 'bar' | |
} | |
} | |
file{'/tmp/test': | |
ensure => 'file', | |
content => template('test/test.erb'), | |
} | |
} |
This file contains 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
<% @domains.each do |domain_name, data| -%> | |
<%= domain_name.gsub(/\./, '_') %> has been <%= data['detail'] %> | |
<% end -%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment