Skip to content

Instantly share code, notes, and snippets.

@hunner
Forked from robinbowes/gist:2955697
Created June 19, 2012 18:16
Show Gist options
  • Save hunner/2955705 to your computer and use it in GitHub Desktop.
Save hunner/2955705 to your computer and use it in GitHub Desktop.
applications:
app::core::instance:
'01':
index: '01'
'02':
index: '02'
Puppet::Parser::Functions.newfunction(:hiera_resources, :type => :statement) do |args|
raise Puppet::Error, "hiera_resources requires 1 argument; got #{args.length}" if args.length != 1
apps = function_hiera_hash(args[0], {})
apps.each do |res_type, resources|
function_create_resources(res_type, resources)
end
end
hostclass applications do
apps = function_hiera_hash('applications')
apps.each do |res_type, resources|
function_create_resources(res_type, resources)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment