mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-14 08:53:07 -06:00
DCD-890: Add setting the metadata on the local instance too.
This commit is contained in:
@@ -33,13 +33,25 @@
|
||||
Key: "atl:deployment:first-run"
|
||||
Value: "{{ ansible_date_time.iso8601 }}"
|
||||
|
||||
- name: Set the first-run tags on the ASG
|
||||
# Set the tags on the ASG and the local instance. We need to
|
||||
# ignore errors as it's possible we don't have the permissions,
|
||||
# and we can't check up-front.
|
||||
- name: Set the first-run tags on the ASG ("FAIL" is not critical)
|
||||
command: "aws autoscaling
|
||||
create-or-update-tags
|
||||
--region {{ ansible_ec2_placement_region }}
|
||||
--tags '{{ deployment_firstrun_meta | to_json }}'"
|
||||
ignore_errors: true
|
||||
|
||||
- name: Set the tags on the local instance ("FAIL" is not critical)
|
||||
ec2_tag:
|
||||
region: "{{ ansible_ec2_placement_region }}"
|
||||
resource: "{{ ansible_ec2_instance_id }}"
|
||||
tags:
|
||||
"atl:deployment:commit": "{{ git_out.stdout }}"
|
||||
"atl:deployment:first-run": "{{ ansible_date_time.iso8601 }}"
|
||||
ignore_errors: true
|
||||
|
||||
when:
|
||||
- ec2_autoscaling_group != ''
|
||||
- ec2_instance_tags.tags['atl:deployment:first-run'] is not defined
|
||||
ignore_errors: true
|
||||
|
||||
Reference in New Issue
Block a user