Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Commit decb6fb

Browse files
aws_profile_for_asg_management (#758)
* aws_profile_for_asg_management * aws_profile_for_asg_management_case_with_default_profile_absent
1 parent ae07a66 commit decb6fb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

roles/asg_management/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ asg_management:
44
name: "" # if the deploy is on an ASG put the name here
55
#target_group_name: "example" # matches the ASG name by default, specify if your TargetGroup name is different (for example due to the 32-char name length limit in AWS)
66
refresh_asg_instances: true # runs only if squashFS image unmount failed and this set to true.
7-
#profile: "example" # optional, the boto profile name to use if not the system default
7+
profile: "{{ lookup('env','AWS_PROFILE') | trim | default(omit) }}" # the boto profile name to use if not the system default (if doesn't exist, then EC2 instance IAM profile will be used)
88
region: "eu-west-1"
99
suspend_processes: "Launch Terminate HealthCheck" # space separated string, see https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html
1010
pause: 10 # localhost ping count, to wait before polling the AWS API again for instance statuses (instead of ansible 'pause' module which seems to be buggy and hangs sometimes)

roles/deploy_code/tasks/cleanup.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@
255255
amazon.aws.autoscaling_group:
256256
name: "{{ asg_management.name }}"
257257
region: "{{ asg_management.region }}"
258-
profile: "{{ asg_management.profile | default(aws_profile | default(omit)) }}"
258+
profile: "{{ asg_management.profile | default(omit) }}"
259259
suspend_processes: []
260260
delegate_to: localhost
261261
run_once: true
@@ -267,7 +267,7 @@
267267
amazon.aws.autoscaling_instance_refresh:
268268
name: "{{ asg_management.name }}"
269269
region: "{{ asg_management.region }}"
270-
profile: "{{ asg_management.profile | default(aws_profile | default(omit)) }}"
270+
profile: "{{ asg_management.profile | default(omit) }}"
271271
strategy: Rolling
272272
preferences:
273273
min_healthy_percentage: 51

0 commit comments

Comments
 (0)