W3cubDocs

/Ansible 2.10

containers.podman.podman_network – Manage podman networks

Note

This plugin is part of the containers.podman collection.

To install it use: ansible-galaxy collection install containers.podman.

To use it in a playbook, specify: containers.podman.podman_network.

New in version 1.0.0: of containers.podman

Synopsis

  • Manage podman networks with podman network command.

Requirements

The below requirements are needed on the host that executes this module.

  • podman

Parameters

Parameter Choices/Defaults Comments
debug
boolean
    Choices:
  • no
  • yes
Return additional information which can be helpful for investigations.
disable_dns
boolean
    Choices:
  • no
  • yes
disable dns plugin (default "false")
driver
string
Driver to manage the network (default "bridge")
executable
string
Default:
"podman"
Path to podman executable if it is not in the $PATH on the machine running podman
gateway
string
IPv4 or IPv6 gateway for the subnet
internal
boolean
    Choices:
  • no
  • yes
Restrict external access from this network (default "false")
ip_range
string
Allocate container IP from range
macvlan
string
Create a Macvlan connection based on this device
name
string / required
Name of the network
recreate
boolean
    Choices:
  • no
  • yes
Recreate network even if exists.
state
string
    Choices:
  • present
  • absent
State of network, default 'present'
subnet
string
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.50-192.168.22.150
    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 Returned Description
network
list / elements=string
always
Facts from created or updated networks

Sample:
[{'cniVersion': '0.4.0', 'name': 'podman', 'plugins': [{'bridge': 'cni-podman0', 'ipMasq': True, 'ipam': {'ranges': [[{'gateway': '10.88.0.1', 'subnet': '10.88.0.0/16'}]], 'routes': [{'dst': '0.0.0.0/0'}], 'type': 'host-local'}, 'isGateway': True, 'type': 'bridge'}, {'capabilities': {'portMappings': True}, 'type': 'portmap'}, {'backend': 'iptables', 'type': 'firewall'}]}]


Authors

  • Sagi Shnaidman (@sshnaidm)

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/containers/podman/podman_network_module.html