Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Commit

Permalink
#214 Add the ability to configure health check params
Browse files Browse the repository at this point in the history
indentation fixed
  • Loading branch information
misnyo committed Jan 8, 2016
1 parent d0896c4 commit ed31238
Showing 1 changed file with 8 additions and 22 deletions.
30 changes: 8 additions & 22 deletions lib/puppet/provider/elb_loadbalancer/v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ def self.load_balancer_to_hash(region, load_balancer)
end
health_check = {}
unless load_balancer.health_check.nil?
health_check = {
'healthy_threshold' => load_balancer.health_check.healthy_threshold,
'interval' => load_balancer.health_check.interval,
'target' => load_balancer.health_check.target,
'timeout' => load_balancer.health_check.timeout,
'unhealthy_threshold' => load_balancer.health_check.unhealthy_threshold,
}
health_check = {
'healthy_threshold' => load_balancer.health_check.healthy_threshold,
'interval' => load_balancer.health_check.interval,
'target' => load_balancer.health_check.target,
'timeout' => load_balancer.health_check.timeout,
'unhealthy_threshold' => load_balancer.health_check.unhealthy_threshold,
}
end
tag_response = elb_client(region).describe_tags(
load_balancer_names: [load_balancer.load_balancer_name]
Expand Down Expand Up @@ -153,7 +153,7 @@ def create
@property_hash[:ensure] = :present

if ! resource[:health_check].nil?
self.health_check = resource[:health_check]
self.health_check = resource[:health_check]
end

instances = resource[:instances]
Expand Down Expand Up @@ -258,20 +258,6 @@ def subnets=(value)
def flush
update unless @property_hash[:ensure] == :absent
end

def health_check=(value)
elb = elb_client(resource[:region])
elb.configure_health_check({
load_balancer_name: name,
health_check: {
target: value['target'],
interval: value['interval'],
timeout: value['timeout'],
unhealthy_threshold: value['unhealthy_threshold'],
healthy_threshold: value['healthy_threshold'],
},
})
end

def health_check=(value)
elb = elb_client(resource[:region])
Expand Down

0 comments on commit ed31238

Please sign in to comment.