feat: add ZFS facts to prevent zpool disk changes (#410)
- add zfs_zpools and zfs_datasets facts to detect existing ZFS resources - skip zpool creation when pools already exist Reviewed-on: #410
This commit was merged in pull request #410.
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user