lib/utils/puppetdb.rb in lita-puppet-0.5.4 vs lib/utils/puppetdb.rb in lita-puppet-0.5.5
- old
+ new
@@ -17,7 +17,15 @@
d["data"]["resources"].each {|r| tags.concat(r['tags'])}
# return all the tags related to profile:: or role::
tags.sort.uniq.select {|t| t.match /^(profile|role)::/ }
end
+
+ def class_nodes(url, classname)
+ client = ::PuppetDB::Client.new(server: url)
+ q = client.request('resources',[:and,[:'=','type', 'Class'],[:'=','title',"#{classname}"]])
+
+ q.data.map { |node| node['certname'] }
+ end
+
end
end