Control a TrueNAS box using its API.
- Tested with 2.10.8
This collection consists primarily of a set of Ansible modules to configure a TrueNAS machine, using the TrueNAS API to control the Middleware Daemon.
There are several ways to talk to the Middleware, but at present this
collection only supports running midclt
commands on the box. So you
will need root access there, just as for any other Ansible client. In
the future, it may support RESTful control.
Name | Description |
---|---|
arensb.truenas.filesystem |
Manage ZFS filesystems. |
arensb.truenas.group |
Manage Unix groups. |
arensb.truenas.hostname |
Set the hostname. |
arensb.truenas.jail |
Set up a jail. |
arensb.truenas.jails |
Manage the jail system. |
arensb.truenas.nfs |
Manage NFS service configuration. |
arensb.truenas.plugin |
Manage plugins and their jails. |
arensb.truenas.pool_snapshot_task |
Periodic snapshots of ZFS volumes. |
arensb.truenas.service |
Manage services. |
arensb.truenas.sharing_nfs |
Manage NFS exports. |
arensb.truenas.sharing_smb |
Manage SMB shares. |
arensb.truenas.systemdataset |
Manage the system dataset. |
arensb.truenas.user |
Manage users. |
The easiest way to install this collection is through Ansible Galaxy:
ansible-galaxy collection install arensb.truenas
- name: Example tasks
collections:
- arensb.truenas
hosts: truenas-box
become: yes
tasks:
- name: Set the hostname
hostname:
name: new-hostname
- name: Turn on sshd
service:
name: sshd
Note that since several of the module names are the same as builtin ones, you may want to use the full name to avoid confusion:
- hosts: truenas-box
become: yes
tasks:
- arensb.truenas.hostname:
name: new-hostname
The individual modules also have documentation strings, and should work with
ansible-doc
, e.g.:
ansible-doc -t module arensb.truenas.user
The best way to contribute a patch or feature is to create a pull request.
The plugins/modules/template
file provides a starting point for new modules.
See changelog.yaml
- Andrew Arensburger (@arensb)
- Ed Hull (https://github.com/edhull)