arensb.truenas.plugin module – Manage plugins.

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.plugin.

New in arensb.truenas 1.1.0

Synopsis

  • Install, remove, and manage TrueNAS plugins.

Parameters

Parameter

Comments

enabled

boolean

Whether the plugin is started at boot time.

Choices:

  • false

  • true

name

string / required

Name of the plugin instance.

This is different from the plugin package: you can run multiple copies of the same software package in different jails, if you give them all unique names.

plugin

string

The human-friendly name of the plugin, as displayed in the TrueNAS console.

If plugin_id is supplied, plugin is ignored.

plugin_id

string

The ID or slug of the plugin. Unlike the name, this is not displayed in the TrueNAS web UI.

Overrides plugin.

repository

string

Name of the repository in which to look for the plugin. This is displayed in the TrueNAS Plugins UI under “Browse a Collection”.

Overridden by repository_url.

repository_url

string

The URL of the repository containing the plugin.

If specified, repository_url overrides repository.

state

string

Whether the plugin should exist or not.

If ‘absent’, the plugin (and its jail) will be removed.

If ‘present’, the plugin will be installed if necessarily, but if it isn’t running, won’t be started.

‘running’ and ‘stopped’ allow you to make sure the plugin’s jail is up or down.

‘restarted’ will restart the plugin’s jail, similar to rebooting it.

Choices:

  • "absent"

  • "present" ← (default)

  • "restarted"

  • "running"

  • "stopped"

Examples

- name: Install a plugin by name from any collection
  arensb.truenas.plugin:
    name: Plex
    # The value of the "plugin" parameter can be copied from
    # the Plugins page on the TrueNAS web interface.
    plugin: Plex Media Server

- name: Install a plugin by name from a specific collection
  arensb.truenas.plugin:
    name: Plex 2
    plugin: Plex Media Server
    repository: iXsystems

- name: "Fully specified: use both plugin ID and repository URL"
  arensb.truenas.plugin:
    name: Plex 3
    plugin_id: plexmediaserver
    repository_url: https://github.com/ix-plugin-hub/iocage-plugin-index.git

# Install two instances of a plugin in different jails.
- arensb.truenas.plugin:
    name: Brad's Library
    plugin: Calibre-Web
    repository: Community
- arensb.truenas.plugin:
    name: Janet's Library
    plugin: Calibre-Web
    repository: Community

# Install a plugin and configure its jail
- name: Install a plugin by name
  arensb.truenas.plugin:
    name: Plex
    plugin: Plex Media Server
  register: plugin_status
- name: Mount filesystems
  arensb.truenas.jail_fstab:
    # The default value here is so that this play doesn't fail
    # in check mode when the plugin hasn't been installed yet.
    jail: "{{ plugin_status.plugin.id | default('nonexistent') }}"
    fstab:
      - src: /mnt/mypool/data
        mount: /data
      - src: /mnt/mypool/data2
        mount /data/more-data

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

plugin

string

An object describing a newly-created plugin.

Returned: success