Skip to content

Commit

Permalink
Improve doc to show support for IPv6 CIDR block (#634) (#751)
Browse files Browse the repository at this point in the history
[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.
  • Loading branch information
patchback[bot] authored Mar 29, 2022
1 parent 83a9db6 commit 8c1595a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
17 changes: 6 additions & 11 deletions plugins/modules/ec2_vpc_route_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8c1595a

Please sign in to comment.