Important
This was only ever tested against TOS v4, and since then I have replaced the OS on my device. No future updates will be made to this project.
Manage a TerraMaster NAS device with Ansible over SSH.
This has only been tested against a TerraMaster F5-422 (TOS v4). You risk damaging your device and data here, so please do not attempt anything without careful consideration.
-
Install Ansible
-
Clone this repository
-
Connect over SSH and edit the
/etc/ssh/sshd_configto update theAllowUsersto include your unique userAllowUsers admin myuser -
Add a public key to
~/.ssh/authorized_keys(disable SSH password authentication in/etc/ssh/sshd_configif you like) -
Change the permissions on
/dev/nullto666to prevent an Ansible failure$ sudo chmod 666 /dev/null $ ls -l /dev/null crw-rw-rw- 1 root root 1, 3 Oct 10 20:19 /dev/null
- Rename the
inventory.examplefile toinventory.ini - Update the values of
ansible_host,ansible_port,ansible_ssh_private_key_file, andansible_userwithininventory.inias appropriate - Run the
example-playbook.ymlplaybook to confirm that Ansible is connecting without error to your TNAS (TerraMaster NAS).
The -K flag will prompt for the root user's password
$ ansible-playbook -i ./inventory.ini -K ./example-playbook.yml
BECOME password:
PLAY [TerraMaster] ************************************************************************************************************
TASK [Gathering Facts] ********************************************************************************************************
ok: [F5-422]
TASK [ping] *******************************************************************************************************************
ok: [F5-422]
PLAY RECAP ********************************************************************************************************************
F5-422 : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0As the TerraMaster does not use a standard Linux distribution, there are many Ansible modules that will likely not work as you expect.