aboutsummaryrefslogtreecommitdiff
path: root/roles/zfs/tasks/dataset-check-duplicate.yml
blob: 1272765832f902c08c60f5f9304fefc9b00480b4 (plain)
1
2
3
4
5
6
7
8
9
10
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