community.general.zpool module – Manage ZFS zpools
Note
This module is part of the community.general collection (version 11.2.1).
You might already have this collection installed if you are using the ansible
package.
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 community.general
.
To use it in a playbook, specify: community.general.zpool
.
New in community.general 11.0.0
Synopsis
Create, destroy, and modify ZFS zpools and their vdev layouts, pool properties, and filesystem properties.
Parameters
Parameter |
Comments |
---|---|
Alternate root for mounting filesystems. |
|
If Choices:
|
|
Dictionary of ZFS filesystem properties to set on the root dataset (for example Default: |
|
If Choices:
|
|
Filesystem mountpoint for the root dataset. |
|
Name of the zpool to manage. |
|
Dictionary of ZFS pool properties to set (for example Default: |
|
Whether the pool should exist. Choices:
|
|
Temporary name used during pool creation. |
|
List of vdev definitions for the pool. |
|
List of device paths to include in this vdev. |
|
Special vdev role (for example Choices:
|
|
Vdev topology (for example Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: partial In check mode, any |
Can run in |
|
Support: full |
Returns details on what has changed (or possibly needs changing in |
Examples
- name: Create pool "tank" on /dev/sda
community.general.zpool:
name: tank
vdevs:
- disks:
- /dev/sda
- name: Create mirrored pool "tank"
community.general.zpool:
name: tank
vdevs:
- type: mirror
disks:
- /dev/sda
- /dev/sdb
- name: Add a cache device to tank
community.general.zpool:
name: tank
vdevs:
- disks:
- /dev/sda
- role: cache
disks:
- /dev/nvme0n1
- name: Set pool and filesystem properties
community.general.zpool:
name: tank
pool_properties:
ashift: 12
filesystem_properties:
compression: lz4
vdevs:
- disks:
- /dev/sda
- name: Destroy pool "tank"
community.general.zpool:
name: tank
state: absent