Class: Ogre::Base

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/ogre/base.rb

Overview

Base ogre class includes common parameters used to authenticate with Chef::REST

Instance Method Summary collapse

Instance Method Details

#chef_restObject

Parameters passed in from cli will take precedence



15
16
17
18
19
20
# File 'lib/ogre/base.rb', line 15

def chef_rest
  Chef::Config.node_name = options[:run_as] || Config.options[:run_as]
  Chef::Config.client_key = options[:key_path] || Config.options[:key_path]
  if Config.options[:ssl_verify_mode] == 'false' then Chef::Config.ssl_verify_mode = :verify_none end
  Chef::ServerAPI.new(options[:server_url] || Config.options[:server_url], api_version: '0')
end