Skip to content

Instantly share code, notes, and snippets.

@cwarden
Created December 3, 2011 00:54
Show Gist options
  • Select an option

  • Save cwarden/1425566 to your computer and use it in GitHub Desktop.

Select an option

Save cwarden/1425566 to your computer and use it in GitHub Desktop.
$var = [ { name => 'x' } ]
file { '/tmp/test-merge.txt':
content => inline_template('<% scope.lookupvar("::var").each do |h| %>Name: <%= h["name"] %> <% end %>')
}
class hasharraytest {
Class['hasharraytest'] -> File['/tmp/test-merge.txt']
$::var += [ { name => 'y' } ]
}
include hasharraytest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment