- Docs »
- containers.podman.podman_volume – Manage Podman volumes
-
You are reading the latest community version of the Ansible documentation. Red Hat subscribers, select 2.9 in the version selection to the left for the most recent Red Hat release.
containers.podman.podman_volume – Manage Podman volumes
Note
This plugin is part of the containers.podman collection (version 1.5.0).
To install it use: ansible-galaxy collection install containers.podman
.
To use it in a playbook, specify: containers.podman.podman_volume
.
New in version 1.1.0: of containers.podman
The below requirements are needed on the host that executes this module.
Parameter |
Choices/Defaults |
Comments |
debug
boolean
|
|
Return additional information which can be helpful for investigations.
|
driver
string
|
|
Specify volume driver name (default local).
|
executable
string
|
Default:
"podman"
|
Path to podman executable if it is not in the $PATH on the machine running podman
|
label
dictionary
|
|
Add metadata to a pod volume (e.g., label com.example.key=value).
|
name
string
/ required
|
|
Name of volume.
|
options
list
/ elements=string
|
|
Set driver specific options. For example 'device=tpmfs', 'type=tmpfs'.
|
recreate
boolean
|
|
Recreate volume even if exists.
|
state
string
|
Choices:
present ←
- absent
|
State of volume, default 'present'
|
# What modules does for example
- podman_volume:
state: present
name: volume1
label:
key: value
key2: value2
options:
- "device=/dev/loop1"
- "type=ext4"
Common return values are documented here, the following are the fields unique to this module:
Key |
Returned |
Description |
volume
dictionary
|
always |
Volume inspection results if exists.
Sample:
{'CreatedAt': '2020-06-05T16:38:55.277628769+03:00', 'Driver': 'local', 'Labels': {'key.com': 'value', 'key.org': 'value2'}, 'Mountpoint': '/home/user/.local/share/containers/storage/volumes/test/_data', 'Name': 'test', 'Options': {}, 'Scope': 'local'}
|