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 new options for podman_network #856

Merged
merged 1 commit into from
Sep 29, 2024
Merged
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
39 changes: 39 additions & 0 deletions plugins/modules/podman_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,24 @@
- Add network options. Currently 'vlan' and 'mtu' are supported.
type: dict
suboptions:
bclim:
description:
- Set the threshold for broadcast queueing. Must be a 32 bit integer.
Setting this value to -1 disables broadcast queueing altogether.
type: int
required: false
bridge_name:
description:
- This option assigns the given name to the created Linux Bridge.
Sets 'com.docker.network.bridge.name' option.
type: str
required: false
driver_mtu:
description:
- Sets the Maximum Transmission Unit (MTU) and takes an integer value.
Sets 'com.docker.network.driver.mtu' option.
type: str
required: false
isolate:
description:
- This option isolates networks by blocking traffic between those
Expand All @@ -147,6 +165,11 @@
- MTU size for bridge network interface.
type: int
required: false
no_default_route:
description:
- If set to 1, Podman will NOT automatically add a default route to subnets.
type: str
required: false
parent:
description:
- The host device which should be used for the macvlan interface
Expand All @@ -159,6 +182,13 @@
- VLAN tag for bridge which enables vlan_filtering.
type: int
required: false
vrf:
description:
- This option assigns a VRF to the bridge interface.
It accepts the name of the VRF and defaults to none.
Can only be used with the Netavark network backend.
type: str
required: false
debug:
description:
- Return additional information which can be helpful for investigations.
Expand Down Expand Up @@ -359,6 +389,10 @@ def addparam_internal(self, c):
def addparam_opt(self, c):
for opt in self.params['opt'].items():
if opt[1] is not None:
if opt[0] == 'bridge_name':
opt = ('com.docker.network.bridge.name', opt[1])
if opt[0] == 'driver_mtu':
opt = ('com.docker.network.driver.mtu', opt[1])
c += ['--opt',
b"=".join([to_bytes(k, errors='surrogate_or_strict')
for k in opt])]
Expand Down Expand Up @@ -813,6 +847,11 @@ def main():
mode=dict(type='str', required=False),
parent=dict(type='str', required=False),
vlan=dict(type='int', required=False),
bclim=dict(type='int', required=False),
no_default_route=dict(type='str', required=False),
vrf=dict(type='str', required=False),
bridge_name=dict(type='str', required=False),
driver_mtu=dict(type='str', required=False),
)),
executable=dict(type='str', required=False, default='podman'),
debug=dict(type='bool', default=False),
Expand Down