Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions roles/asg_management/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
delegate_to: localhost
run_once: true
block:
- name: Gather information about target group.
community.aws.elb_target_group_info:
region: "{{ asg_management.region }}"
profile: "{{ asg_management.profile | default(omit) }}"
names:
- "{{ asg_management.name }}"
register: _target_group

- name: Loop over target instances until they are all 'healthy'.
ansible.builtin.include_tasks: asg_target_health.yml

# @TODO - the autoscaling_group module can do this - https://docs.ansible.com/ansible/latest/collections/amazon/aws/autoscaling_group_module.html
- name: Suspend autoscale processes on ASG via a specified boto profile.
ansible.builtin.command: >-
Expand All @@ -27,17 +38,6 @@
when:
- asg_management.profile is not defined

- name: Gather information about target group.
community.aws.elb_target_group_info:
region: "{{ asg_management.region }}"
profile: "{{ asg_management.profile | default(omit) }}"
names:
- "{{ asg_management.name }}"
register: _target_group

- name: Loop over target instances until they are all 'healthy'.
ansible.builtin.include_tasks: asg_target_health.yml

- name: Resume all autoscale processes on ASG.
ansible.builtin.command: >-
aws autoscaling resume-processes
Expand Down