πŸ“ Modify or Retire TrueNAS Shares

Change or retire SMB/NFS exports using configure_truenas.yml while preserving datasets and retained data. Use Add TrueNAS Shares for new exports and Manage TrueNAS Dataset Permissions and ACLs for access-policy changes.

πŸ“‹ Prerequisites

πŸ“ Procedure to Complete

  1. Notify owners and drain SMB sessions or unmount NFS clients safely, accounting for in-flight writes.
  2. Define the migration path and client-side changes before changing the export.
  3. Review the entire selected inventory stage and document the exact desired-state change.
  4. Preview, approve, and apply only the intended share change using the existing playbook.
  5. Verify unrelated exports and update client/deployment definitions to prevent accidental recreation.

πŸ”Ž Ansible Integration

SMB lookup uses name; NFS lookup uses path. Changing a lookup key can create another export while leaving the old export present. Omitting an entry does not delete it; explicit state: absent does. Dataset deletion is not supported by this role and is not part of share retirement.

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

This lists scope only. Before adding apply commands, account for all SMB/NFS definitions, truenas_resources, and non-idempotent truenas_post_calls selected by this tag. Do not stop a protocol service shared by other exports.

βœ… Verification and Recovery