Management of Docker volumes
New in version 2017.7.0.
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.
Ensure that a volume is absent.
New in version 2015.8.4.
Changed in version 2017.7.0: This state was renamed from docker.volume_absent to docker_volume.absent
Name of the volume
Usage Examples:
volume_foo:
docker_volume.absent
Ensure that a volume is present.
New in version 2015.8.4.
Changed in version 2015.8.6: This state no longer deletes and re-creates a volume if the existing
volume's driver does not match the driver
parameter (unless the
force
parameter is set to True
).
Changed in version 2017.7.0: This state was renamed from docker.volume_present to docker_volume.present
Name of the volume
Type of driver for that volume. If None
and the volume
does not yet exist, the volume will be created using Docker's
default driver. If None
and the volume does exist, this
function does nothing, even if the existing volume's driver is
not the Docker default driver. (To ensure that an existing
volume's driver matches the Docker default, you must
explicitly name Docker's default driver here.)
Options for the volume driver
If the volume already exists but the existing volume's driver
does not match the driver specified by the driver
parameter, this parameter controls whether the function errors
out (if False
) or deletes and re-creates the volume (if
True
).
New in version 2015.8.6.
Usage Examples:
volume_foo:
docker_volume.present
volume_bar:
docker_volume.present
- name: bar
- driver: local
- driver_opts:
foo: bar
volume_bar:
docker_volume.present
- name: bar
- driver: local
- driver_opts:
- foo: bar
- option: value