From dc09ddfbd53b8af1f55366336cbae232c7b78621 Mon Sep 17 00:00:00 2001 From: Will Thames Date: Thu, 19 Apr 2018 03:19:54 +1000 Subject: [PATCH] elb_target_group: use port parameter as default for target port (#38578) The docs suggest that `port` parameter is the default port upon which targets listen. As such, a target need only provide a `Port` key to override the default. --- lib/ansible/modules/cloud/amazon/elb_target_group.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/elb_target_group.py b/lib/ansible/modules/cloud/amazon/elb_target_group.py index eb5918e259..26a0407f0f 100644 --- a/lib/ansible/modules/cloud/amazon/elb_target_group.py +++ b/lib/ansible/modules/cloud/amazon/elb_target_group.py @@ -502,7 +502,7 @@ def create_or_update_target_group(connection, module): instances_to_add = [] for target in params['Targets']: if target['Id'] in add_instances: - instances_to_add.append({'Id': target['Id'], 'Port': int(target['Port'])}) + instances_to_add.append({'Id': target['Id'], 'Port': int(target.get('Port', module.params.get('port')))}) changed = True try: