Sha256: 164b708b039cce415d9544c82dc34d90bc390d8bfb4c263ed2ef0bf3b213236f

Contents?: true

Size: 464 Bytes

Versions: 2

Compression:

Stored size: 464 Bytes

Contents

require 'praegustator'
require 'chef/rest'
require 'chef/search/query'

module Praegustator
  module Wrappers
    class Chef
      def self.search query
        ::Chef::Config.from_file(File.expand_path(Praegustator.config['chef']['knife_location']))
        chef_query = ::Chef::Search::Query.new
        nodes = chef_query.search('node',query).first rescue []
        nodes.map{|n| Praegustator::Node.new n.name , n.ipaddress ,query}
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
praegustator-0.2.0 lib/praegustator/wrappers/chef.rb
praegustator-0.1.0 lib/praegustator/wrappers/chef.rb