I want to search nodes that was run recipes.
I want to check my code in separate file, after that integrate them into
recipe
My file is:
#!/opt/chef/embedded/bin/ruby
require 'chef’
require ‘chef/knife/search’
require 'chef/knife’
require 'chef/search/query’
require ‘chef/knife/search’
I think that i can search trivil with this method, but it is not working
Will be ideal to use this method
nodes = search(:node, “:”)
nodes.each do |nod|
puts nod
nod.recipe? "cbacula::client"
end
I found this example at (
http://www.opscode.com/blog/2011/04/22/chef-0-10-preview-knife-plugins-and-ui/),
but i am frusrating to use it because of fuzzier_query var not
understandable for me.
|
fuzzier_query = "tags:||#{@query} OR roles:#{@query} OR
fqdn:#{@query} OR addresses:#{@query}"|
knife_search = Chef::Search.new
knife_search.name_args = [‘node’, fuzzier_query]
knife_search.run
How can i find objects of class node on my chef server ?
I think that i am on the wrong way because recipe context and separate
script not the same things.
I tried to use shef -z, but the documentation on its use, which I was
found very small.
Thank you very much.
–
Best regards,
CVisionLab System Administrator
Vladmir Skubriev