Class: Chef::Provider::LoadBalancer
- Inherits:
-
LWRPBase
- Object
- LWRPBase
- Chef::Provider::LoadBalancer
- Defined in:
- lib/chef/provider/load_balancer.rb
Instance Attribute Summary collapse
-
#lb_spec ⇒ Object
readonly
Returns the value of attribute lb_spec.
Instance Method Summary collapse
- #action_handler ⇒ Object
- #create_loadbalancer(lb_spec) ⇒ Object
- #new_driver ⇒ Object
- #update_loadbalancer(lb_spec) ⇒ Object
- #whyrun_supported? ⇒ Boolean
Instance Attribute Details
#lb_spec ⇒ Object (readonly)
Returns the value of attribute lb_spec.
42 43 44 |
# File 'lib/chef/provider/load_balancer.rb', line 42 def lb_spec @lb_spec end |
Instance Method Details
#action_handler ⇒ Object
11 12 13 |
# File 'lib/chef/provider/load_balancer.rb', line 11 def action_handler @action_handler ||= Chef::Provisioning::ChefProviderActionHandler.new(self) end |
#create_loadbalancer(lb_spec) ⇒ Object
60 61 62 63 64 |
# File 'lib/chef/provider/load_balancer.rb', line 60 def create_loadbalancer(lb_spec) new_driver.allocate_load_balancer(action_handler, lb_spec, ) lb_spec.save(action_handler) new_driver.ready_load_balancer(action_handler, lb_spec, ) end |
#new_driver ⇒ Object
19 20 21 |
# File 'lib/chef/provider/load_balancer.rb', line 19 def new_driver @new_driver ||= run_context.chef_provisioning.driver_for(new_resource.driver) end |
#update_loadbalancer(lb_spec) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/chef/provider/load_balancer.rb', line 45 def update_loadbalancer(lb_spec) machines = Hash[ *(new_resource.machines).collect { |machine_name| [machine_name, get_machine_spec(machine_name)] }.flatten ] new_driver.update_load_balancer(action_handler, lb_spec, , { :machines => machines } ) lb_spec. = new_resource. lb_spec.machines = new_resource.machines lb_spec.save(action_handler) end |
#whyrun_supported? ⇒ Boolean
15 16 17 |
# File 'lib/chef/provider/load_balancer.rb', line 15 def whyrun_supported? true end |