feat: add ZFS facts to prevent zpool disk changes
Build / precommit (pull_request) Successful in 3m34s

- add zfs_zpools and zfs_datasets facts to detect existing ZFS resources
- skip zpool creation when pools already exist
This commit is contained in:
2025-10-18 21:13:19 +11:00
parent 98b866fce7
commit c2cb2f994d
3 changed files with 43 additions and 2 deletions
+5 -2
View File
@@ -38,8 +38,11 @@ class zfs (
# create zpools
$zpools.each | $zpool, $data | {
zpool { $zpool:
* => $data
# Only create zpool if it doesn't already exist
if $facts['zfs_zpools'] == undef or !($zpool in $facts['zfs_zpools']) {
zpool { $zpool:
* => $data
}
}
}