|
|
@ -130,6 +130,17 @@ options:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- The identifier of the virtual private cloud (VPC). Required when I(state) is C(present).
|
|
|
|
- The identifier of the virtual private cloud (VPC). Required when I(state) is C(present).
|
|
|
|
required: false
|
|
|
|
required: false
|
|
|
|
|
|
|
|
wait:
|
|
|
|
|
|
|
|
description:
|
|
|
|
|
|
|
|
- Whether or not to wait for the target group.
|
|
|
|
|
|
|
|
type: bool
|
|
|
|
|
|
|
|
default: false
|
|
|
|
|
|
|
|
version_added: "2.4"
|
|
|
|
|
|
|
|
wait_timeout:
|
|
|
|
|
|
|
|
description:
|
|
|
|
|
|
|
|
- The time to wait for the target group.
|
|
|
|
|
|
|
|
default: 200
|
|
|
|
|
|
|
|
version_added: "2.4"
|
|
|
|
extends_documentation_fragment:
|
|
|
|
extends_documentation_fragment:
|
|
|
|
- aws
|
|
|
|
- aws
|
|
|
|
- ec2
|
|
|
|
- ec2
|
|
|
@ -515,7 +526,7 @@ def create_or_update_target_group(connection, module):
|
|
|
|
if module.params.get("wait"):
|
|
|
|
if module.params.get("wait"):
|
|
|
|
status_achieved, registered_instances = wait_for_status(connection, module, tg['TargetGroupArn'], instances_to_add, 'healthy')
|
|
|
|
status_achieved, registered_instances = wait_for_status(connection, module, tg['TargetGroupArn'], instances_to_add, 'healthy')
|
|
|
|
if not status_achieved:
|
|
|
|
if not status_achieved:
|
|
|
|
module.fail_json(msg='Error waiting for target registration - please check the AWS console')
|
|
|
|
module.fail_json(msg='Error waiting for target registration to be healthy - please check the AWS console')
|
|
|
|
|
|
|
|
|
|
|
|
remove_instances = set(current_instance_ids) - set(new_instance_ids)
|
|
|
|
remove_instances = set(current_instance_ids) - set(new_instance_ids)
|
|
|
|
|
|
|
|
|
|
|
@ -578,7 +589,7 @@ def create_or_update_target_group(connection, module):
|
|
|
|
if module.params.get("wait"):
|
|
|
|
if module.params.get("wait"):
|
|
|
|
status_achieved, registered_instances = wait_for_status(connection, module, tg['TargetGroupArn'], params['Targets'], 'healthy')
|
|
|
|
status_achieved, registered_instances = wait_for_status(connection, module, tg['TargetGroupArn'], params['Targets'], 'healthy')
|
|
|
|
if not status_achieved:
|
|
|
|
if not status_achieved:
|
|
|
|
module.fail_json(msg='Error waiting for target registration - please check the AWS console')
|
|
|
|
module.fail_json(msg='Error waiting for target registration to be healthy - please check the AWS console')
|
|
|
|
|
|
|
|
|
|
|
|
# Now set target group attributes
|
|
|
|
# Now set target group attributes
|
|
|
|
update_attributes = []
|
|
|
|
update_attributes = []
|
|
|
@ -685,8 +696,8 @@ def main():
|
|
|
|
targets=dict(type='list'),
|
|
|
|
targets=dict(type='list'),
|
|
|
|
unhealthy_threshold_count=dict(type='int'),
|
|
|
|
unhealthy_threshold_count=dict(type='int'),
|
|
|
|
vpc_id=dict(),
|
|
|
|
vpc_id=dict(),
|
|
|
|
wait_timeout=dict(type='int'),
|
|
|
|
wait_timeout=dict(type='int', default=200),
|
|
|
|
wait=dict(type='bool')
|
|
|
|
wait=dict(type='bool', default=False)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|