πŸ’Ύ Create and Modify TrueNAS Datasets

Manage filesystem datasets through truenas_datasets and configure_truenas.yml. Pool creation, dataset deletion, data migration, and block-storage provisioning are outside this procedure. See Add TrueNAS Local Users and Manage TrueNAS Dataset Permissions and ACLs for exposure and access.

πŸ“‹ Prerequisites

πŸ“ Procedure to Complete

  1. Add reviewed examples for an empty filesystem dataset and a child dataset, preserving existing truenas_datasets entries.
  2. Distinguish mutable properties from truenas_dataset_create_only_keys in the defaults.
  3. Preview and apply only the dataset stage after confirming parent dependencies.
  4. Establish permissions and backup policy before exposing the path to clients.
  5. Define a migration procedure rather than suggesting in-place changes to creation-only encryption, type, or share-preset fields.

πŸ”Ž Ansible Integration

ansible-playbook -i inventory/truenas/inventory.ini playbooks/truenas/configure_truenas.yml --limit truenas-01 --tags truenas_datasets --list-tasks --ask-vault-pass

This lists preflight and all configured datasets. Dataset tasks create or adjust filesystem datasets but never delete them. The tag does not create users, shares, or services, and check mode does not create paths for later share validation. Omitting or renaming a dataset definition does not migrate or remove existing data.

βœ… Verification and Recovery