Module: Ridley::BootstrapBinding::ClassMethods

Defined in:
lib/ridley/mixin/bootstrap_binding.rb

Instance Method Summary collapse

Instance Method Details

#default_optionsHash

A hash of default options to be used in the Context initializer

Returns:

  • (Hash)


19
20
21
22
23
24
25
26
27
28
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 19

def default_options
  @default_options ||= {
    validator_client: "chef-validator",
    attributes: Hash.new,
    run_list: Array.new,
    environment: "_default",
    sudo: true,
    hints: Hash.new
  }
end

#validate_options(options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 6

def validate_options(options = {})
  if options[:server_url].nil?
    raise Errors::ArgumentError, "A server_url is required for bootstrapping"
  end

  if options[:validator_path].nil?
    raise Errors::ArgumentError, "A path to a validator is required for bootstrapping"
  end
end