diff options
Diffstat (limited to 'roles/zfs/tasks/dataset-check-duplicate.yml')
| -rw-r--r-- | roles/zfs/tasks/dataset-check-duplicate.yml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/roles/zfs/tasks/dataset-check-duplicate.yml b/roles/zfs/tasks/dataset-check-duplicate.yml new file mode 100644 index 0000000..1272765 --- /dev/null +++ b/roles/zfs/tasks/dataset-check-duplicate.yml @@ -0,0 +1,11 @@ +- name: Check if ZFS dataset exists + community.general.zfs_facts: + dataset: "{{ zfs_dataset }}" + register: zfs_dataset_exists_check + ignore_errors: true + +- name: Fail if ZFS dataset already exists + ansible.builtin.fail: + msg: "Dataset {{ zfs_dataset }} is already in-use." + when: not zfs_dataset_exists_check.failed + |
