arensb.truenas.pool_snapshot_task module – Maintain periodic disk pool snapshot tasks.
Note
This module is part of the arensb.truenas collection (version 1.11.5).
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 arensb.truenas
.
To use it in a playbook, specify: arensb.truenas.pool_snapshot_task
.
New in arensb.truenas 1.5.0
Synopsis
Creates, deletes, and configures disk pool snapshot tasks.
Parameters
Parameter |
Comments |
---|---|
When true, empty snapshots may be created. This can be useful when there are two overlapping sets of snapshots, e.g., a daily set and a weekly set: the weekly snapshot may be empty because the daily one already contains the changes to the filesystem, but you still want to keep the weekly snapshot when the daily one has expired. Choices:
|
|
Time at which to begin taking snapshots. This is a string in the form “HH:MM” See also |
|
The name of the dataset to snapshot. This can be a pool, ZFS dataset, or zvol. |
|
Day of month when the task should run, in cron format. |
|
Whether this snapshot task is enabled. |
|
Time at which to stop taking snapshots. This is a string in the form “HH:MM” See also |
|
A list of child datasets to exclude from snapshotting. If a snapshot task is non-recursive, it may not have an exclude list, so if you specify a non-empty exclude list to a non-recursive task, this module will silently clear it. |
|
Hour when the task should run, in cron format. |
|
A unit of time for the snapshot lifetime before it is deleted.
One of the following units of time:
Along with Choices:
|
|
The number of units of time that the snapshot will exist before it is deleted. Used in conjunction with |
|
A snapshot task does not have a name or other visible unique identifier, so the The If the |
|
Name of the dataset being snapshotted. This can be a pool, dataset, or zvol. |
|
This is a regular expression that the |
|
Minute when the task should run, in cron format. |
|
Month when the task should run, in cron format. |
|
A template specifying the name of the snapshot. This must include
the strings “%Y”, “%m”, “%d”, “%H”, and “%M”. Their meanings are
as in |
|
Whether to take snapshots of the child datasets, as well as of the dataset itself. Choices:
|
|
Whether the task should exist or not. Choices:
|
|
Day of week when the task should run, in cron format. |
Examples
- name: Hourly snapshots of data/vol1
hosts: myhost
collections: arensb.truenas
become: yes
tasks:
- pool_snapshot_task:
match:
dataset: data/vol1
name_format: "hourly-"
dataset: data/vol1
# Keep them for 7 days
lifetime_value: 7
lifetime_unit: days
name_format: "hourly-%Y-%m-%d_%H:%M"
# Snapshot everything under data/vol1, with a couple of exceptions.
recursive: yes
exclude:
- data/vol1/ex1
- data/vol1/ex2
# Take snapshots every 2 hours on weekdays
minute: "*"
hour: "*/2"
day: "*"
month: "*"
weekday: Mon-Fri
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
List of tasks that were deleted when Returned: success |
|
A data structure describing a newly-created snapshot task. Returned: Success, when created. Sample: |