Class: Chef::Resource::LoadBalancer

Inherits:
LWRPBase
  • Object
show all
Defined in:
lib/chef/resource/load_balancer.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ LoadBalancer

Returns a new instance of LoadBalancer.



12
13
14
15
16
17
18
# File 'lib/chef/resource/load_balancer.rb', line 12

def initialize(*args)
  super
  @chef_environment = run_context.cheffish.current_environment
  @chef_server = run_context.cheffish.current_chef_server
  @driver = run_context.chef_metal.current_driver
  @load_balancer_options = run_context.chef_metal.current_load_balancer_options
end

Instance Method Details

#add_load_balancer_options(options) ⇒ Object



30
31
32
# File 'lib/chef/resource/load_balancer.rb', line 30

def add_load_balancer_options(options)
  @load_balancer_options = Cheffish::MergedConfig.new(options, @load_balancer_options)
end

#load_prior_resource(*args) ⇒ Object

This is here because metal users will probably want to do things like: machine “foo”

action :destroy

end

with_load_balancer_options :bootstrap_options => … machine “foo”

converge true

end

Without this, the first resource’s machine options will obliterate the second resource’s machine options, and then unexpected (and undesired) things happen.



47
48
49
# File 'lib/chef/resource/load_balancer.rb', line 47

def load_prior_resource(*args)
  Chef::Log.debug "Overloading #{self.resource_name} load_prior_resource with NOOP"
end