arensb.truenas.service module – Manage TrueNAS services

Note

This module is part of the arensb.truenas collection (version 1.11.4).

To install it, use: ansible-galaxy collection install arensb.truenas.

To use it in a playbook, specify: arensb.truenas.service.

New in arensb.truenas 0.1.0

Synopsis

  • Controls services on TrueNAS, such as NFS, SMB, SSH, and others.

Parameters

Parameter

Comments

enabled

boolean

Whether the service is enabled (True) or disabled (False)

Choices:

  • false

  • true

ha_propagate

string

I don’t know. I think this is for High Availability in TrueNAS Enterprise.

name

string / required

Name of the service.

state

string

started/stopped: make sure the service is started/stopped.

restarted will unconditionally restart the service.

reloaded will unconditionally reload the service.

At least one of state and enabled is required.

Choices:

  • "started"

  • "stopped"

  • "restarted"

  • "reloaded"

Examples

- name: Enable ssh
  hosts: my-truenas-server
  tasks:
    - arensb.truenas.service:
        name: ssh
        enabled: yes

- name: Make sure unwanted services are turned off
  hosts: my-truenas-server
  tasks:
    - arensb.truenas.service:
        name: nfs
        enabled: no