This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

TrueNAS

    This root preserves the adopted default RAIDZ2 pool, seven datasets and Nextcloud lifecycle settings. Existing imported addresses remain unchanged. Settings are inline HCL; there is no JSON configuration interface.

    This root owns the encrypted default/encrypted/approles parent and one account for each entity member of Vault’s truenas_admins and truenas_user groups. Vault owns membership: the NAS AppRole is an administrator, and the user group projects the other canonical AppRoles. The shared parent permits traversal without listing. NAS groups mirror Vault membership. Only truenas_admins grants the FULL_ADMIN privilege. Ordinary accounts have no administrative privilege; no account gets SSH login, web shell or sudo rights. Long account names are shortened deterministically; namespace and share names retain the full AppRole. SMB transport encryption is mandatory.

    The reusable dataset module owns filesystem defaults, private ACLs and optional DEFAULT_SHARE exports. This root does not load the AppRole storage projects. Each project owns its namespace, ACLs, shares and child datasets in its own Terraform state, with independent plan/apply targets. The development project owns the runner cache. Namespaces are created by their project’s apply, not account provisioning. VM provisioning consumes the XO repository and does not authenticate to TrueNAS.

    64-character passwords are generated by the pinned random provider and retained only in Vault-backed state and Vault KV. NAS publishes each account at secrets/alwaldend.com/vault1/shared/read/approle/<approle>/nas. Existing shared-read policies let each AppRole read its own account. XCP-ng reads its own account for the cache connection; the development NAS project owns its traversal and MODIFY grants. Coordinate password rotation with clients. Increment nas_password_version to regenerate passwords and update TrueNAS together; the same version drives password keepers and the write-only rotation trigger.

    The existing NAS API credential comes from its Vault truenas entry. State uses tf_backend/truenas, separate from DNS. The provider is pinned to 1.9.3; TLS verification is enabled. API roles are method-based and do not enforce dataset path restrictions. Both shared and AppRole storage roots use NAS’s administrator identity; namespace accounts do not receive that credential. AppRole state uses distinct backend paths and does not depend on this root’s state outputs.

    Apply the Vault NAS access groups, account-publisher and lookup grants before planning this root. Unlock the encrypted root before provisioning namespaces or mounting shares. The authorized rollout provisioned the accounts and shared settings; the subsequent plan has no changes.

    bazel run //infra/nas/truenas:tf.plan
    bazel test //infra/nas/truenas:tf_tests.fmt_test //infra/nas/truenas:tf_tests.validate_test