• AnsibleFest
  • Products
  • Community
  • Webinars & Training
  • Blog
Ansible Logo
Ansible Collections Documentation
Ansible collections
  • arensb.truenas.filesystem module – Manage ZFS datasets (filesystems/volumes) via TrueNAS middleware
  • arensb.truenas.group module – Manage groups
  • arensb.truenas.hostname module – Set the hostname.
  • arensb.truenas.initscript module – Manage init/shutdown scripts.
  • arensb.truenas.jail module – Manage a jail
  • arensb.truenas.jail_fstab module – Manage a jail’s fstab
  • arensb.truenas.jails module – Configure jail system
  • arensb.truenas.mail module – Manage TrueNAS email settings
  • arensb.truenas.nfs module – Configure NFS service
  • arensb.truenas.plugin module – Manage plugins.
  • arensb.truenas.pool_scrub_task module – Schedule periodic scrub of ZFS pools.
  • arensb.truenas.pool_snapshot_task module – Maintain periodic disk pool snapshot tasks.
  • arensb.truenas.service module – Manage TrueNAS services
  • arensb.truenas.sharing_nfs module – Manage NFS sharing
  • arensb.truenas.sharing_smb module – Manage SMB sharing
  • arensb.truenas.smart module – Configure S.M.A.R.T. service
  • arensb.truenas.smart_test_task module – Schedule S.M.A.R.T. tests
  • arensb.truenas.systemdataset module – Manage the system dataset.
  • arensb.truenas.truenas_facts module – Gather TrueNAS-related facts
    • Synopsis
    • Notes
    • See Also
    • Examples
    • Return Values
      • Collection links
  • arensb.truenas.user module – Manage user accounts
Ansible collections
  • arensb.truenas.truenas_facts module – Gather TrueNAS-related facts

arensb.truenas.truenas_facts module – Gather TrueNAS-related facts

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

New in arensb.truenas 1.7.0

  • Synopsis

  • Notes

  • See Also

  • Examples

  • Return Values

Synopsis

  • Gather facts about a TrueNAS host, in the same way as setup does.

  • Any facts discovered by this module will be mixed in with those discovered by other modules such as setup.

  • See https://docs.ansible.com/ansible/latest/reference_appendices/config.html#facts-modules for how to use this module, as well as the Examples section.

  • You can set the environment variable ANSIBLE_FACTS_MODULES to arensb.truenas.truenas_facts to use only this module to gather facts, or to setup, arensb.truenas.truenas_facts to use both the standard setup module and this one.

  • Likewise, you can set the ansible_facts_modules inventory variable to the list of modules to use, either just arensb.truenas.truenas_facts, or [setup, arensb.truenas.truenas_facts].

  • This module may be used on non-TrueNAS hosts: it should simply fail gracefully and do nothing.

Notes

Note

  • Supports check_mode.

  • Should run correctly on non-TrueNAS hosts.

See Also

See also

Ansible Configuration Settings

Configure which fact-gathering modules to use.

Examples

- name: Manually gather information
  collections: arensb.truenas
  hosts: myhost
  tasks:
    - name: Gather TrueNAS-specific facts
      arensb.truenas.truenas_facts:
    # ansible_facts should have TrueNAS facts mixed in with the usual ones.
    - debug: var=ansible_facts

Return Values

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

Key

Description

ansible_facts.truenas_boot_id

string

The host’s unique boot identifier. Changes every time the system boots.

Returned: always

Sample: "1f065a66-a5de-464d-a6b3-f786143028fc"

ansible_facts.truenas_build_time

string

The system build time, when the OS was built.

Internally, this is a Python datetime.datetime object, and is converted to a string by the time it gets to the Ansible client.

Returned: success

Sample: "2023-05-29T06:50:20"

ansible_facts.truenas_environment

string

The environment in which TrueNAS is running. One of DEFAULT or EC2.

Returned: always

Sample: "DEFAULT"

ansible_facts.truenas_features

dictionary

A map that says, for each system feature, whether it is enabled or not.

Returned: success

Sample: {"DEDUP": true, "FIBRECHANNEL": false, "JAILS": true, "VM": true}

ansible_facts.truenas_host_id

string

A hex string based on (but not identical to) the contents of /etc/hostid.

This ID is permanent and persists across both reboots and upgrades, so it can be used as a unique identifier for the machine.

Returned: always

Sample: "6f7145029674ad4f49fac7090dce20de0d02eef3bb462c25dce3ab15a367ac41"

ansible_facts.truenas_product_name

string

A string giving the overall name of the product, usually TrueNAS

Returned: always

Sample: "TrueNAS"

ansible_facts.truenas_product_type

string

The flavor of TrueNAS. One of CORE, ENTERPRISE, or SCALE.

Returned: always

Sample: "CORE"

ansible_facts.truenas_state

string

The current state of the system, one of BOOTING, SHUTTING_DOWN, or READY.

Returned: always

Sample: "READY"

ansible_facts.truenas_system_info

complex

A dictionary with a number of facts about the system. See the sample value below.

Returned: always

Sample: {"birthday": {"$date": 1677351513088}, "boottime": {"$date": 1685626178000}, "buildtime": {"$date": 1685357420000}, "cores": 8, "datetime": {"$date": 1689648269852}, "ecc_memory": false, "hostname": "myhost.dom.ain", "license": null, "loadavg": [0.2568359375, 0.28369140625, 0.2607421875], "model": "AMD(R) Razor(R) CPU  J1900  @ 3.99GHz", "physmem": 8421797888, "system_manufacturer": "To be filled by O.E.M.", "system_product": "To be filled by O.E.M.", "system_product_version": "To be filled by O.E.M.", "system_serial": "To be filled by O.E.M.", "timezone": "America/New_York", "uptime": "46 days, 13:14:50.823465", "uptime_seconds": 4022090.823465127, "version": "TrueNAS-13.0-U5"}

Collection links

Issue Tracker Repository (Sources)

Previous Next

© Copyright Ansible contributors.