-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add metadata options to ec2 template (#322)
* add metadata options to ec2 template
- Loading branch information
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
changelogs/fragments/322-ec2_launch_template-add-metadata_options.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minor_changes: | ||
- ec2_launch_template - added ``metadata_options`` parameter to support changing the IMDS configuration for instances (https://github.com/ansible-collections/community.aws/pull/322). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
tests/integration/targets/ec2_launch_template/tasks/instance-metadata.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
- block: | ||
- name: metadata_options | ||
ec2_launch_template: | ||
name: "{{ resource_prefix }}-test-metadata" | ||
metadata_options: | ||
http_put_response_hop_limit: 1 | ||
http_tokens: required | ||
state: present | ||
register: metadata_options_launch_template | ||
- name: instance with metadata_options created with the right options | ||
assert: | ||
that: | ||
- metadata_options_launch_template is changed | ||
- "metadata_options_launch_template.latest_template.launch_template_data.metadata_options.http_put_response_hop_limit == 1" | ||
- "metadata_options_launch_template.latest_template.launch_template_data.metadata_options.http_tokens == 'required'" | ||
always: | ||
- name: delete the template | ||
ec2_launch_template: | ||
name: "{{ resource_prefix }}-test-metadata" | ||
state: absent | ||
register: del_lt | ||
retries: 10 | ||
until: del_lt is not failed | ||
ignore_errors: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters