PARALLAX

docker_network

Create and remove Docker networks and their options

Collection: community.docker

Full Name: parallax.community.general.docker_network

Aliases: community.general.docker_network, docker_network, community.docker.docker_network

Synopsis

Create and remove Docker networks and their options

Parameters

NameTypeRequiredDefaultDescription
namestringyesName of the Docker network
statestringpresentState of the network Choices: present, absent
driverstringbridgeNetwork driver to use
driver_optionsrawDictionary of driver options; legacy comma-separated key=value pairs are also accepted
ipam_driverstringIPAM driver to use
ipam_configrawList of IPAM configuration dictionaries; legacy subnet=x,gateway=y is also accepted
ipam_optionsrawDictionary of IPAM driver options
enable_ipv6boolEnable IPv6 networking
internalboolRestrict external access to the network
forceboolfalseForce recreation of an existing network
labelsrawDictionary of labels; legacy comma-separated key=value pairs are also accepted
scopestringNetwork scope (local, global, swarm)
attachableboolEnable manual container attachment
connectedlistContainers to attach to the network
appendsboolfalseKeep existing connected containers
docker_hoststringDocker socket or TCP URL; defaults to DOCKER_HOST or unix:///var/run/docker.sock
api_versionstringDocker API version; defaults to DOCKER_API_VERSION or auto
timeoutintRequest timeout in seconds; defaults to DOCKER_TIMEOUT or 60
tlsboolEnable TLS without server verification; defaults to DOCKER_TLS
validate_certsboolVerify TLS certificates; defaults to DOCKER_TLS_VERIFY
tls_hostnamestringExpected TLS server name; defaults to DOCKER_TLS_HOSTNAME
ca_pathstringCA certificate file
client_certstringTLS client certificate
client_keystringTLS client private key
use_ssh_clientboolfalseSelect OpenSSH for SSH Docker transports
debugboolfalseEnable diagnostic mode

Example

yaml
- name: Create the backend network
  docker_network:
    name: backend
    driver: bridge
    internal: true
    state: present
Search
    ↑ ↓ move↵ openesc close