-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for template_tags and purge_template_tags
- Loading branch information
Showing
5 changed files
with
103 additions
and
21 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
changelogs/fragments/20240110-ec2_launch_template-refactor.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
minor_changes: | ||
- ec2_launch_template - Refactor module to use shared code from ``amazon.aws.plugins.module_utils.ec2`` and update ``RETURN`` block (https://github.com/ansible-collections/community.aws/pull/2164). | ||
- ec2_launch_template - add the possibility to delete specific versions of a launch template using ``versions_to_delete`` (https://github.com/ansible-collections/community.aws/pull/2164). | ||
- ec2_launch_template - add the ``purge_tags`` option (https://github.com/ansible-collections/community.aws/pull/2164). | ||
- ec2_launch_template - Add the possibility to delete specific versions of a launch template using ``versions_to_delete`` (https://github.com/ansible-collections/community.aws/pull/2164). | ||
- ec2_launch_template - Add support for template tags via ``template_tags`` and ``purge_template_tags`` options (https://github.com/ansible-collections/community.aws/issues/176). |
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
52 changes: 52 additions & 0 deletions
52
tests/integration/targets/ec2_launch_template/tasks/limits.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,52 @@ | ||
--- | ||
# Add integration tests for issue https://github.com/ansible-collections/community.aws/issues/2131 | ||
- name: Test creation/deletion of launch template with more 200 versions | ||
vars: | ||
test_launch_template_name: "{{ resource_prefix }}-limits" | ||
test_total_versions: "{{ range(1, 205) }}" | ||
block: | ||
- name: Create a Launch template with more than 200 versions using | ||
community.aws.ec2_launch_template: | ||
name: "{{ test_launch_template_name }}" | ||
instance_type: t2.micro | ||
version_description: "Version number {{ item }}" | ||
source_version: 1 | ||
default_version: 1 | ||
with_items: "{{ test_total_versions }}" | ||
|
||
- name: Retrieve Launch template information | ||
amazon.aws.ec2_launch_template_info: | ||
filters: | ||
launch-template-name: "{{ test_launch_template_name }}" | ||
register: _templates | ||
|
||
- name: Ensure the Launch template was created as expected | ||
ansible.builtin.assert: | ||
that: | ||
- _templates.launch_templates | length == 1 | ||
- _templates.launch_templates[0].versions | length == test_total_versions | length | ||
|
||
- name: Delete the launch template | ||
community.aws.ec2_launch_template: | ||
name: "{{ test_launch_template_name }}" | ||
state: absent | ||
register: _delete_templ | ||
|
||
- name: Retrieve Launch template information | ||
amazon.aws.ec2_launch_template_info: | ||
filters: | ||
launch-template-name: "{{ test_launch_template_name }}" | ||
register: _templates | ||
|
||
- name: Ensure the Launch template does not exist anymore | ||
ansible.builtin.assert: | ||
that: | ||
- _delete_templ is changed | ||
- _templates.launch_templates | length == 0 | ||
|
||
always: | ||
- name: Delete launch template | ||
community.aws.ec2_launch_template: | ||
state: absent | ||
name: "{{ test_launch_template_name }}" | ||
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
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