From 8c1595a4cad2a2c042dc502abc08530d26ae7c9c Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 13:10:39 +0000 Subject: [PATCH] Improve doc to show support for IPv6 CIDR block (#634) (#751) [PR #634/c06d77c9 backport][stable-3] Improve doc to show support for IPv6 CIDR block This is a backport of PR #634 as merged into main (c06d77c). SUMMARY Improve doc to show IPv6 CIDR blocks are supported. Add example with IPv6 CIDR block. Add missing attribute to return values. Remove duplicate assertions in integration tests. Add tests for IPv6 subnets in integration tests. ISSUE TYPE Bugfix Pull Request COMPONENT NAME ec2_vpc_route_table ADDITIONAL INFORMATION While testing IPv6 in this module, I discovered the ipsubnet filter does not work if the prefix length has a fairly high value such as /120. I was running an integration test with a /120 subnet in this PR, but the ipsubnet call never returns and uses 100% CPU. I changed the value to a /64 subnet so this PR can pass. The ipsubnet issue needs to be fixed in ansible.netcommon and the netaddr package. I've created a unit test to reproduce the problem: ansible-collections/ansible.netcommon#362 The integration tests in this PR depend on #631 for the VPC configuration. --- plugins/modules/ec2_vpc_route_table.py | 17 ++++++----------- .../targets/ec2_vpc_route_table/tasks/main.yml | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/plugins/modules/ec2_vpc_route_table.py b/plugins/modules/ec2_vpc_route_table.py index 45fa6cccf28..81fb40ce6a1 100644 --- a/plugins/modules/ec2_vpc_route_table.py +++ b/plugins/modules/ec2_vpc_route_table.py @@ -48,18 +48,13 @@ type: str routes: description: - - > - List of routes in the route table. - - > - Routes are specified as dicts containing the keys 'dest' and one of 'gateway_id', - 'instance_id', 'network_interface_id', or 'vpc_peering_connection_id'. - - > - The value of 'dest' is used for the destination match. It may be a IPv4 CIDR block + - List of routes in the route table. + - Routes are specified as dicts containing the keys C(dest) and one of C(gateway_id), + C(instance_id), C(network_interface_id), or C(vpc_peering_connection_id). + - The value of C(dest) is used for the destination match. It may be a IPv4 CIDR block or a IPv6 CIDR block. - - > - If 'gateway_id' is specified, you can refer to the VPC's IGW by using the value 'igw'. - - > - Routes are required for present states. + - If I(gateway_id) is specified, you can refer to the VPC's IGW by using the value C(igw). + - Routes are required for present states. type: list elements: dict state: diff --git a/tests/integration/targets/ec2_vpc_route_table/tasks/main.yml b/tests/integration/targets/ec2_vpc_route_table/tasks/main.yml index 9ac3fb69f02..cf78b5b00b5 100644 --- a/tests/integration/targets/ec2_vpc_route_table/tasks/main.yml +++ b/tests/integration/targets/ec2_vpc_route_table/tasks/main.yml @@ -514,7 +514,7 @@ lookup: id purge_tags: yes tags: - Name: Public routeroute_spec table + Name: Public route table Updated: new_tag check_mode: true register: check_mode_results