Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ec2_eni: Fix idempotency when security_groups is specified #337

Merged
merged 5 commits into from
Jul 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- ec2_eni - fix idempotency when ``security_groups`` attribute is specified (https://github.com/ansible-collections/amazon.aws/pull/337).
2 changes: 1 addition & 1 deletion plugins/modules/ec2_eni.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ def get_sec_group_list(groups):
# Build list of remote security groups
remote_security_groups = []
for group in groups:
remote_security_groups.append(group["GroupId"].encode())
remote_security_groups.append(group["GroupId"])

return remote_security_groups

Expand Down
1 change: 1 addition & 0 deletions tests/integration/targets/ec2_eni/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
region: "{{ aws_region }}"

collections:
- ansible.netcommon
- community.aws

block:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
- _interface_0.private_dns_name is string
- _interface_0.private_dns_name.endswith("ec2.internal")
- '"private_ip_address" in _interface_0'
- _interface_0.private_ip_address | ipaddr()
- _interface_0.private_ip_address | ansible.netcommon.ipaddr
- _interface_0.private_ip_address == ip_1
- '"private_ip_addresses" in _interface_0'
- _interface_0.private_ip_addresses | length == 1
Expand Down Expand Up @@ -152,7 +152,7 @@
- _interface_0.private_dns_name is string
- _interface_0.private_dns_name.endswith("ec2.internal")
- '"private_ip_address" in _interface_0'
- _interface_0.private_ip_address | ipaddr()
- _interface_0.private_ip_address | ansible.netcommon.ipaddr
- _interface_0.private_ip_address == ip_5
- '"private_ip_addresses" in _interface_0'
- _interface_0.private_ip_addresses | length == 1
Expand Down