Skip to content

Commit

Permalink
fix: ensure role is idempotent and supports check mode
Browse files Browse the repository at this point in the history
Cause: Role was not idempotent, and did not support check mode.

Consequence: Users could not use role to ensure idempotence or
check state.

Fix: The role has been fixed to return `"changed": true` if the
role changed the state of the system, and `false` otherwise.  This
means that some operations that used to return an error, such as
trying to snapshot a volume that already had a snapshot, or trying
to remove a snapshot that does not exist, will no longer return
an error, but will instead just report `"changed": false`.  Users
should use the `list` operation to examine state of the system.

Result: The role is idempotent and supports check mode.

Signed-off-by: Rich Megginson <[email protected]>
  • Loading branch information
richm committed Feb 20, 2024
1 parent bb5b41f commit 816ee3e
Show file tree
Hide file tree
Showing 30 changed files with 732 additions and 222 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ This variable is required. It supports one of the following values:

- `remove`: Remove snapshots that conform to the specified prefix and pattern

- `revert`: Revert to snapshots that are specifed by either the pattern or set. If either the source LV or
snapshot are open, the merge is deferred until the next time the server reboots and the
source logical volume is activated.
- `revert`: Revert to snapshots that are specified by either the pattern or set.
If either the source LV or snapshot are open, the merge is deferred
until the next time the server reboots and the source logical volume
is activated.

- `extend`: Extend snapshot to have at least snapshot_lvm_percent_space_required space allocated to the
snapshot. Allocations are rounded up to the next multiple of the volume group extent size.
- `extend`: Extend snapshot to have at least snapshot_lvm_percent_space_required
space allocated to the snapshot. Allocations are rounded up to the
next multiple of the volume group extent size.

### snapshot_lvm_set

Expand Down Expand Up @@ -108,8 +110,6 @@ that it applies, for example:
The mount_origin flag defaults to false, so it is not necessary when the user is mounting the
snapshot rather than the origin.
If before running the role, with :
### snapshot_lvm_snapset_name
This variable is required. snapshot_lvm_snapset_name is a string that will be
Expand Down Expand Up @@ -218,7 +218,7 @@ When used inside of a snapset definition, use mount_origin parameter.
### snapshot_lvm_unmount_all

If set to true, unmount all mountpoint for the resulting blockdevice.
Linux allows filesytems to be mounted in multiple locations. Setting
Linux allows filesystems to be mounted in multiple locations. Setting
this flag will unmount all locations.

### snapshot_lvm_vg_include
Expand Down
Loading

0 comments on commit 816ee3e

Please sign in to comment.