PARALLAX

docker_volume

Create and remove named Docker volumes

Collection: community.docker

Full Name: parallax.community.general.docker_volume

Aliases: community.general.docker_volume, docker_volume, community.docker.docker_volume

Synopsis

Create and remove named Docker volumes

Parameters

NameTypeRequiredDefaultDescription
namestringyesName of the Docker volume
statestringpresentState of the volume Choices: present, absent
driverstringlocalVolume driver to use
driver_optionsrawDictionary of driver options; legacy comma-separated key=value pairs are also accepted
labelsrawDictionary of labels; legacy comma-separated key=value pairs are also accepted
recreatestringneverWhen to recreate the volume Choices: never, options-changed, always
forceboolfalseForce removal of volume even if in use
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 a named volume for the database
  docker_volume:
    name: pgdata
    state: present
Search
    ↑ ↓ move↵ openesc close