salt.states.docker_network

Management of Docker networks

New in version 2017.7.0.

depends:docker Python module

Note

Older releases of the Python bindings for Docker were called docker-py in PyPI. All releases of docker, and releases of docker-py >= 1.6.0 are supported. These python bindings can easily be installed using pip.install:

salt myminion pip.install docker

To upgrade from docker-py to docker, you must first uninstall docker-py, and then install docker:

salt myminion pip.uninstall docker-py
salt myminion pip.install docker

These states were moved from the docker state module (formerly called dockerng) in the 2017.7.0 release.

salt.states.docker_network.absent(name, driver=None)

Ensure that a network is absent.

name
Name of the network

Usage Examples:

network_foo:
  docker_network.absent
salt.states.docker_network.present(name, driver=None, containers=None)

Ensure that a network is present.

name
Name of the network
driver
Type of driver for that network.
containers:
List of container names that should be part of this network

Usage Examples:

network_foo:
  docker_network.present
network_bar:
  docker_network.present
    - name: bar
    - containers:
        - cont1
        - cont2