containers.podman.podman_volume module – Manage Podman volumes¶
Note
This module is part of the containers.podman collection (version 1.15.2).
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install containers.podman
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: containers.podman.podman_volume
.
New in containers.podman 1.1.0
Synopsis¶
Manage Podman volumes
Requirements¶
The below requirements are needed on the host that executes this module.
podman
Parameters¶
Parameter |
Comments |
---|---|
Return additional information which can be helpful for investigations. Choices:
|
|
Specify volume driver name (default local). |
|
Path to Default: |
|
Add metadata to a pod volume (e.g., label com.example.key=value). |
|
Name of volume. |
|
Set driver specific options. For example ‘device=tpmfs’, ‘type=tmpfs’. UID and GID idempotency is not supported due to changes in podman. |
|
Path to the directory to write quadlet file in. By default, it will be set as |
|
Name of quadlet file to write. By default it takes name value. |
|
Options for the quadlet file. Provide missing in usual network args options as a list of lines to add. |
|
Recreate volume even if exists. Choices:
|
|
State of volume, default ‘present’ Choices:
|
Examples¶
# What modules does for example
- name: Create a volume
containers.podman.podman_volume:
state: present
name: volume1
label:
key: value
key2: value2
options:
- "device=/dev/loop1"
- "type=ext4"
- name: Create a Quadlet file for a volume
containers.podman.podman_volume:
state: quadlet
name: quadlet_volume
quadlet_filename: custom-name
quadlet_options:
- Group=192
- Copy=true
- Image=quay.io/centos/centos:latest
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Volume inspection results if exists. Returned: always Sample: |