containers.podman.podman_network module – Manage podman networks
Note
This module is part of the containers.podman collection (version 1.10.2).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install containers.podman
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: containers.podman.podman_network
.
New in containers.podman 1.0.0
Synopsis
Manage podman networks with podman network command.
Requirements
The below requirements are needed on the host that executes this module.
podman
Parameters
Parameter |
Comments |
---|---|
Return additional information which can be helpful for investigations. Choices:
|
|
disable dns plugin (default “false”) Choices:
|
|
Driver to manage the network (default “bridge”) |
|
Path to Default: |
|
IPv4 or IPv6 gateway for the subnet |
|
Restrict external access from this network (default “false”) Choices:
|
|
Allocate container IP from range |
|
Enable IPv6 (Dual Stack) networking. You must pass a IPv6 subnet. The subnet option must be used with the ipv6 option. Choices:
|
|
Create a Macvlan connection based on this device |
|
Name of the network |
|
Add network options. Currently ‘vlan’ and ‘mtu’ are supported. |
|
This option isolates networks by blocking traffic between those that have this option enabled. Choices:
|
|
Sets the Route Metric for the default route created in every container joined to this network. Can only be used with the Netavark network backend. |
|
This option sets the specified ip/macvlan mode on the interface. |
|
MTU size for bridge network interface. |
|
The host device which should be used for the macvlan interface. Defaults to the default route interface. |
|
VLAN tag for bridge which enables vlan_filtering. |
|
Recreate network even if exists. Choices:
|
|
State of network, default ‘present’ Choices:
|
|
Subnet in CIDR format |
Examples
- name: Create a podman network
containers.podman.podman_network:
name: podman_network
become: true
- name: Create internal podman network
containers.podman.podman_network:
name: podman_internal
internal: true
ip_range: 192.168.22.128/25
subnet: 192.168.22.0/24
gateway: 192.168.22.1
become: true
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Facts from created or updated networks Returned: always Sample: |