Skip to content

Instantly share code, notes, and snippets.

@dctrwatson
Created February 13, 2013 22:47
Show Gist options
  • Save dctrwatson/4949092 to your computer and use it in GitHub Desktop.
Save dctrwatson/4949092 to your computer and use it in GitHub Desktop.
Has to be better way of gathering all names of a certain defined resources in Puppet
class info {
define iota() {}
Info::Iota<| |>
$info_template = '<% scope.compiler.catalog.vertices.each do |resource| -%>
<%- if resource.type == "Info::Iota" -%><%= resource.name %>,<% end -%>
<%- end -%>'
$all_iotas = unique(sort(split(chop(inline_template($info_template)),',')))
}
node 'a' {
@info::iota{ 'foo': }
include info
notice(join($info::all_iotas,','))
}
node 'b' inherits 'a' {
@info::iota{ 'bar': }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment