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

Add support to enable multicast on transit gateway #2063

Merged
merged 27 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
23fe103
Add support for multicast option on transit gateway
cschimid Mar 28, 2024
1887e2a
Add support for Multicast option on Transit Gateway
cschimid Mar 28, 2024
e01eb5a
Add info about multicast support for transit gateway
cschimid Mar 28, 2024
114639f
Update ec2_transit_gateway_info.py
cschimid Apr 2, 2024
af489f8
Update ec2_transit_gateway_info.py
cschimid Apr 2, 2024
b207886
Create 2063-add-multicast-support.yml
cschimid Apr 4, 2024
4025c20
Added version_added: 7.3.0 to ec2_transit_gateway.py
cschimid Apr 4, 2024
00b94ba
Added version_added: 7.3.0 to ec2_transit_gateway_info.py
cschimid Apr 4, 2024
9dca7b1
Added options.multicast-support: enable to teste with multiple filters
cschimid Apr 4, 2024
19abc5b
Removed incorrectly inserted text on CHANGELOG.rst
cschimid Apr 4, 2024
00a1009
changed default to false for multicast support
cschimid Apr 4, 2024
a58da99
Changed default to False for Multicast Support
cschimid Apr 4, 2024
a49e45b
removed default for multicast support
cschimid Apr 4, 2024
75c0c71
Update plugins/modules/ec2_transit_gateway.py
cschimid Apr 4, 2024
2250714
Add integration test to create with multicast enabled and check if is…
cschimid Apr 4, 2024
dc93baa
removed multicast filter from multiple filters test
cschimid Apr 4, 2024
986c5ec
fix multicast test
cschimid Apr 4, 2024
e78a2c9
fix multicast test
cschimid Apr 4, 2024
94f59e4
Update main.yml
cschimid Apr 4, 2024
3c3a8f7
Update tests/integration/targets/ec2_transit_gateway/tasks/main.yml
cschimid Apr 5, 2024
f4e0de5
fix some multicast tests
cschimid Apr 5, 2024
4519746
fix issues with multicast test
cschimid Apr 5, 2024
d7b5ae9
Remove trailing whitespace to fix transitgateway.py
cschimid Apr 8, 2024
8959e35
Merge branch 'main' into main
cschimid Apr 8, 2024
47b0a30
fixed CHANGELOG.rst
cschimid Apr 9, 2024
c6c67f3
try to remove trainling whitespace on line 9 ec2_transit_gateway_info.py
cschimid Apr 9, 2024
e90b8bd
bump version_added
tremble Jul 2, 2024
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
23 changes: 0 additions & 23 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,6 @@ community.aws Release Notes

.. contents:: Topics

v7.2.0
Copy link
Contributor

@alinabuzachis alinabuzachis Apr 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cschimid You should restore this part.

======

Release Summary
---------------

This release includes a new module ``dynamodb_table_info``, new features for the ``glue_job`` and ``msk_cluster`` modules, and a bugfix for the ``aws_ssm`` connection plugin.

Minor Changes
-------------

- glue_job - add support for 2 new instance types which are G.4X and G.8X (https://github.com/ansible-collections/community.aws/pull/2048).
- msk_cluster - Support for additional ``m5`` and ``m7g`` types of MSK clusters (https://github.com/ansible-collections/community.aws/pull/1947).

Bugfixes
--------

- ssm(connection) - fix bucket region logic when region is ``us-east-1`` (https://github.com/ansible-collections/community.aws/pull/1908).

New Modules
-----------

- dynamodb_table_info - Returns information about a Dynamo DB table

v7.1.0
======
Expand Down
2 changes: 2 additions & 0 deletions changelogs/fragments/2063-add-multicast-support.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- ec2_transit_gateway - Support for enable multicast on Transit Gateway (https://github.com/ansible-collections/community.aws/pull/2063).
3 changes: 3 additions & 0 deletions plugins/module_utils/transitgateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ def _set_option(self, name, value):
def set_dns_support(self, value):
return self._set_option("DnsSupport", value)

def set_multicast_support(self, value):
return self._set_option("MulticastSupport", value)

def set_ipv6_support(self, value):
return self._set_option("Ipv6Support", value)

Expand Down
14 changes: 14 additions & 0 deletions plugins/modules/ec2_transit_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
- Whether to enable AWS DNS support.
default: true
type: bool
multicast_support:
description:
- Whether to enable AWS Multicast support. Valid only at the time of creation of the Transit Gateway.
type: bool
cschimid marked this conversation as resolved.
Show resolved Hide resolved
version_added: 7.3.0
tremble marked this conversation as resolved.
Show resolved Hide resolved
state:
description:
- C(present) to ensure resource is created.
Expand Down Expand Up @@ -91,6 +96,7 @@
asn: 64514
auto_associate: false
auto_propagate: false
multicast_support: true
dns_support: true
description: "nonprod transit gateway"
purge_tags: false
Expand Down Expand Up @@ -181,6 +187,12 @@
returned: always
type: str
sample: enable
multicast_support:
description: Indicates whether Multicast support is enabled.
returned: always
type: str
cschimid marked this conversation as resolved.
Show resolved Hide resolved
cschimid marked this conversation as resolved.
Show resolved Hide resolved
sample: enable
version_added: 7.3.0
owner_id:
description: The account that owns the transit gateway.
returned: always
Expand Down Expand Up @@ -362,6 +374,7 @@ def create_tgw(self, description):
options["DefaultRouteTablePropagation"] = self.enable_option_flag(self._module.params.get("auto_propagate"))
options["VpnEcmpSupport"] = self.enable_option_flag(self._module.params.get("vpn_ecmp_support"))
options["DnsSupport"] = self.enable_option_flag(self._module.params.get("dns_support"))
options["MulticastSupport"] = self.enable_option_flag(self._module.params.get("multicast_support"))

try:
response = self._connection.create_transit_gateway(Description=description, Options=options)
Expand Down Expand Up @@ -482,6 +495,7 @@ def setup_module_object():
auto_attach=dict(type="bool", default=False),
auto_propagate=dict(type="bool", default=True),
description=dict(type="str"),
multicast_support=dict(type="bool"),
dns_support=dict(type="bool", default=True),
purge_tags=dict(type="bool", default=True),
state=dict(default="present", choices=["present", "absent"]),
Expand Down
9 changes: 8 additions & 1 deletion plugins/modules/ec2_transit_gateway_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

DOCUMENTATION = r"""
module: ec2_transit_gateway_info
short_description: Gather information about ec2 transit gateways in AWS
short_description: Gather information about ec2 transit gateways in AWS
version_added: 1.0.0
description:
- Gather information about ec2 transit gateways in AWS
Expand Down Expand Up @@ -119,6 +119,13 @@
returned: always
type: str
sample: "enable"
multicast_support:
description:
- Indicates whether Multicast support is enabled.
returned: always
type: str
sample: "enable"
cschimid marked this conversation as resolved.
Show resolved Hide resolved
version_added: 7.3.0
propagation_default_route_table_id:
description:
- The ID of the default propagation route table.
Expand Down
34 changes: 32 additions & 2 deletions tests/integration/targets/ec2_transit_gateway/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
assert:
that:
- create_result.changed == True

- name: test update transit gateway with tags by description
ec2_transit_gateway:
description: "{{ tgw_description }}"
Expand Down Expand Up @@ -75,6 +75,32 @@
assert:
that:
- result.changed == False

- name: generate unique value for testing
set_fact:
tgw_description_multicast: "{{ resource_prefix }}-tgw-multicast"

- name: test create transit gateway with multicast enabled
ec2_transit_gateway:
description: "{{ tgw_description_multicast }}"
multicast_support: true
register: create_result

- name: assert changed is True
assert:
that:
- create_result.changed == True

- name: test success with filter
ec2_transit_gateway_info:
filters:
options.multicast-support: enable
register: result

- name: assert success with multicast-support filter
assert:
that:
- 'result.transit_gateways != []'

# ==== Combine ec2_transit_gateway_info ======================
- name: test success with no parameters
Expand Down Expand Up @@ -129,10 +155,14 @@
that:
- 'result.changed == false'
- 'result.transit_gateways != []'

tremble marked this conversation as resolved.
Show resolved Hide resolved
always:
###### TEARDOWN STARTS HERE ######
- name: delete transit gateway
ec2_transit_gateway:
description: "{{ tgw_description }}"
description: "{{ item }}"
state: absent
ignore_errors: yes
loop:
- "{{ tgw_description }}"
- "{{ tgw_description_multicast }}"
Loading