elb_target_info
Gathers which target groups a target is associated with
Collection: community.aws
Full Name: community.aws.elb_target_info
Synopsis
Gathers which target groups a target is associated with
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| access_key | str | |||
| aws_ca_bundle | path | |||
| aws_config | dict | |||
| debug_botocore_endpoint_logs | bool | false | ||
| endpoint_url | str | |||
| get_unused_target_groups | bool | true | ||
| instance_id | str | yes | ||
| profile | str | |||
| region | str | |||
| secret_key | str | |||
| session_token | str | |||
| validate_certs | bool | true |
Example
yaml
- name: Get initial list of target groups
delegate_to: localhost
community.aws.elb_target_info:
instance_id: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}"
register: target_info
- name: wait for all targets to deregister simultaneously
delegate_to: localhost
community.aws.elb_target_info:
get_unused_target_groups: false
instance_id: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}"
register: target_info
until: (target_info.instance_target_groups | length) == 0
retries: 60
delay: 10
# wait until all groups associated with this instance are 'healthy' or
# 'unused'
- name: wait for registration
community.aws.elb_target_info:
get_unused_target_groups: false
instance_id: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}"
register: target_info
until: (target_info.instance_target_groups | map(attribute='targets') | flatten | map(attribute='target_health') | rejectattr('state', 'equalto', 'healthy') | rejectattr('state', 'equalto', 'unused') | list | length) == 0
retries: 61
delay: 10