ansible-podman-collections icon indicating copy to clipboard operation
ansible-podman-collections copied to clipboard

Support multiple subnets/gatways in containers.podman.podman_network

Open koalaeagle opened this issue 1 year ago • 2 comments

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind feature

Description

Is it possible to support defining multiple subnets and gateways? This can be useful for certain dualstack scenarios.

As far as I can tell, this is not currently supported. However, I am still learning ansible and it is possible I missed something.

An example of this would be:

podman network create -d macvlan --subnet=10.10.0.0/24 --gateway=10.10.0.1 --ip-range=10.10.0.248/29 --subnet= 2001: db8:abcd:10::/64 --gateway= 2001: db8:abcd:10::1 --ipv6 -o parent=eth0.10 dmz

Describe the results you received:

I have tried defining multiple subnet values, but when inspecting the created network only one subnet and gateway is defined. After a quick look at the code, it does not appear that there is logic to handle more than one subnet/gateway.

koalaeagle avatar Jul 18 '23 11:07 koalaeagle

I'm not sure, but is this a question on Podman itself?

nishipy avatar Aug 13 '23 16:08 nishipy

I'm not sure, but is this a question on Podman itself?

Podman already supports this since several releases, but this Ansible collection doesn't yet.

--subnet=subnet

The subnet in CIDR notation. Can be specified multiple times to allocate more than one subnet for this network. The argument order of the --subnet, --gateway and --ip-range options must match. This is useful to set a static ipv4 and ipv6 subnet.

https://docs.podman.io/en/latest/markdown/podman-network-create.1.html#subnet-subnet

I would also be very interested in this feature, my current workaround is copying the network JSON files to /etc/containers/networks/ instead.

DasSkelett avatar Oct 12 '23 23:10 DasSkelett

Added in #762

sshnaidm avatar May 29 '24 20:05 sshnaidm