forked from ansible-collections/community.aws
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ec2_launch_template - scrub None parameters from what we'll pass to c…
…reate_launch_config (ansible-collections#413) * ec2_launch_template - scrub None parameters from what we'll pass to create_launch_config * tests * changelog
- Loading branch information
1 parent
0ec1f94
commit b4d36da
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
bugfixes: | ||
- ec2_launch_template - ensure that empty parameters are properly removed before passing to AWS (https://github.com/ansible-collections/community.aws/issues/230). |
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
53 changes: 53 additions & 0 deletions
53
tests/integration/targets/ec2_launch_template/tasks/network_interfaces.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,53 @@ | ||
- block: | ||
- name: network_interfaces | ||
ec2_launch_template: | ||
name: "{{ resource_prefix }}-test-nic" | ||
state: present | ||
network_interfaces: | ||
- device_index: 0 | ||
associate_public_ip_address: false | ||
delete_on_termination: true | ||
- device_index: 1 | ||
associate_public_ip_address: true | ||
delete_on_termination: false | ||
ipv6_address_count: 1 | ||
register: nic_template | ||
- name: instance with network_interfaces created with the right settings | ||
assert: | ||
that: | ||
- nic_template is changed | ||
- nic_template.default_template.launch_template_data.network_interfaces[0].associate_public_ip_address == False | ||
- nic_template.default_template.launch_template_data.network_interfaces[0].delete_on_termination == True | ||
- nic_template.default_template.launch_template_data.network_interfaces[0].device_index == 0 | ||
- nic_template.default_template.launch_template_data.network_interfaces[1].associate_public_ip_address == True | ||
- nic_template.default_template.launch_template_data.network_interfaces[1].delete_on_termination == False | ||
- nic_template.default_template.launch_template_data.network_interfaces[1].device_index == 1 | ||
- nic_template.default_template.launch_template_data.network_interfaces[1].ipv6_address_count == 1 | ||
|
||
- name: network_interfaces | ||
ec2_launch_template: | ||
name: "{{ resource_prefix }}-test-nic" | ||
state: present | ||
network_interfaces: | ||
- device_index: 0 | ||
associate_public_ip_address: false | ||
delete_on_termination: true | ||
- device_index: 1 | ||
associate_public_ip_address: true | ||
delete_on_termination: false | ||
ipv6_address_count: 1 | ||
register: nic_template | ||
- name: instance with network_interfaces created with the right settings | ||
assert: | ||
that: | ||
- nic_template is not changed | ||
|
||
always: | ||
- name: delete the template | ||
ec2_launch_template: | ||
name: "{{ resource_prefix }}-test-nic" | ||
state: absent | ||
register: del_lt | ||
retries: 10 | ||
until: del_lt is not failed | ||
ignore_errors: true |