community.general.facter_facts module – Runs the discovery program facter on the remote system and return Ansible facts

Note

This module is part of the community.general collection (version 8.5.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: community.general.facter_facts.

New in community.general 8.0.0

Synopsis

  • Runs the facter discovery program (https://github.com/puppetlabs/facter) on the remote system, returning Ansible facts from the JSON data that can be useful for inventory purposes.

Requirements

The below requirements are needed on the host that executes this module.

  • facter

  • ruby-json

Parameters

Parameter

Comments

arguments

list / elements=string

Specifies arguments for facter.

Attributes

Attribute

Support

Description

check_mode

Support: full

This action does not modify state.

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: N/A

This action does not modify state.

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

facts

Support: full

Action returns an ansible_facts dictionary that will update existing host facts.

Examples

- name: Execute facter no arguments
  community.general.facter_facts:

- name: Execute facter with arguments
  community.general.facter_facts:
    arguments:
        - -p
        - system_uptime
        - timezone
        - is_virtual

Returned Facts

Facts returned by this module are added/updated in the hostvars host facts and can be referenced by name just like any other host fact. They do not need to be registered in order to use them.

Key

Description

facter

dictionary

Dictionary containing facts discovered in the remote system.

Returned: always

Authors

  • Ansible Core Team

  • Michael DeHaan