1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-02-04 07:51:50 +00:00

nmcli: allow VxLan multicast and bridge port (#11182)

VxLan virtual devices can be added to bridge ports, like any other
devices. And when using multicast remote addresses,
NetworkManager need to know the parent device as well.

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Tiziano Müller 2025-12-02 21:34:34 +01:00 committed by GitHub
parent 8d51c5f666
commit 76589bd97a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 95 additions and 0 deletions

View file

@ -530,6 +530,11 @@ options:
description:
- This is only used with VXLAN - VXLAN destination IP address.
type: str
vxlan_parent:
description:
- This is only used with VXLAN - VXLAN parent device (required when using a multicast remote address).
type: str
version_added: 12.2.0
vxlan_local:
description:
- This is only used with VXLAN - VXLAN local IP address.
@ -1454,6 +1459,17 @@ EXAMPLES = r"""
vxlan_local: 192.168.1.2
vxlan_remote: 192.168.1.5
- name: Add VxLan via multicast on a bridge
community.general.nmcli:
type: vxlan
conn_name: vxlan_test2
vxlan_id: 17
vxlan_parent: eth1
vxlan_local: 192.168.1.2
vxlan_remote: 239.192.0.17
slave_type: bridge
master: br0
- name: Add gre
community.general.nmcli:
type: gre
@ -1784,6 +1800,7 @@ class Nmcli:
self.ingress = module.params["ingress"]
self.egress = module.params["egress"]
self.vxlan_id = module.params["vxlan_id"]
self.vxlan_parent = module.params["vxlan_parent"]
self.vxlan_local = module.params["vxlan_local"]
self.vxlan_remote = module.params["vxlan_remote"]
self.ip_tunnel_dev = module.params["ip_tunnel_dev"]
@ -2041,6 +2058,7 @@ class Nmcli:
options.update(
{
"vxlan.id": self.vxlan_id,
"vxlan.parent": self.vxlan_parent,
"vxlan.local": self.vxlan_local,
"vxlan.remote": self.vxlan_remote,
}
@ -2256,6 +2274,7 @@ class Nmcli:
"infiniband",
"ovs-port",
"ovs-interface",
"vxlan",
)
@property
@ -2825,6 +2844,7 @@ def create_module() -> AnsibleModule:
egress=dict(type="str"),
# vxlan specific vars
vxlan_id=dict(type="int"),
vxlan_parent=dict(type="str"),
vxlan_local=dict(type="str"),
vxlan_remote=dict(type="str"),
# ip-tunnel specific vars