From 710d1f074e099fa02a9deb7a1bbaff87e255b100 Mon Sep 17 00:00:00 2001 From: Will Thames Date: Wed, 1 Nov 2017 00:27:12 +1000 Subject: [PATCH] Allow health_check_port to be a string (#32228) Setting health_check_port to 'traffic-port' allows the health check to use the target's traffic port. --- lib/ansible/modules/cloud/amazon/elb_target_group.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/elb_target_group.py b/lib/ansible/modules/cloud/amazon/elb_target_group.py index 501b7382cbe..7b43b89b1d5 100644 --- a/lib/ansible/modules/cloud/amazon/elb_target_group.py +++ b/lib/ansible/modules/cloud/amazon/elb_target_group.py @@ -33,6 +33,7 @@ options: health_check_port: description: - The port the load balancer uses when performing health checks on targets. + Can be set to 'traffic-port' to match target port. required: false default: "The port on which each target receives traffic from the load balancer." health_check_path: @@ -361,7 +362,7 @@ def create_or_update_target_group(connection, module): params['HealthCheckProtocol'] = module.params.get("health_check_protocol").upper() if module.params.get("health_check_port") is not None: - params['HealthCheckPort'] = str(module.params.get("health_check_port")) + params['HealthCheckPort'] = module.params.get("health_check_port") if module.params.get("health_check_interval") is not None: params['HealthCheckIntervalSeconds'] = module.params.get("health_check_interval") @@ -623,7 +624,7 @@ def main(): dict( deregistration_delay_timeout=dict(type='int'), health_check_protocol=dict(choices=['http', 'https', 'tcp', 'HTTP', 'HTTPS', 'TCP'], type='str'), - health_check_port=dict(type='int'), + health_check_port=dict(), health_check_path=dict(default=None, type='str'), health_check_interval=dict(type='int'), health_check_timeout=dict(type='int'),