PARALLAX

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

NameTypeRequiredDefaultDescription
access_keystr
aws_ca_bundlepath
aws_configdict
debug_botocore_endpoint_logsboolfalse
endpoint_urlstr
get_unused_target_groupsbooltrue
instance_idstryes
profilestr
regionstr
secret_keystr
session_tokenstr
validate_certsbooltrue

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
Search
    ↑ ↓ move↵ openesc close