Skip to content

Instantly share code, notes, and snippets.

@robinbowes
Created February 1, 2015 01:32
Show Gist options
  • Save robinbowes/ad7a0a8afa51b2902228 to your computer and use it in GitHub Desktop.
Save robinbowes/ad7a0a8afa51b2902228 to your computer and use it in GitHub Desktop.
Puppet templating
class test{
$domains = {
'domain1.tld' => {
'detail' => 'foo'
},
'domain2.tld' => {
'detail' => 'bar'
}
}
file{'/tmp/test':
ensure => 'file',
content => template('test/test.erb'),
}
}
<% @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