ansible.windows.setup module – Gathers facts about remote hosts

Note

This module is part of the ansible.windows collection (version 2.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 ansible.windows.

To use it in a playbook, specify: ansible.windows.setup.

Synopsis

  • This module is automatically called by playbooks to gather useful variables about remote hosts that can be used in playbooks. It can also be executed directly by /usr/bin/ansible to check what variables are available to a host. Ansible provides many facts about the system, automatically.

Parameters

Parameter

Comments

_measure_subset

boolean

For internal use

Choices:

  • false ← (default)

  • true

fact_path

path

Path used for local ansible facts (*.ps1 or *.json) - files in this dir will be run (if a ps1) or read (if a json) and their results be added to the return facts.

The returned fact will be named after the local file (without the extension suffix), e.g. ansible_my_fact.

gather_subset

list / elements=string

If supplied, restrict the additional facts collected to the given subset.

Can specify a list of values to specify a larger subset.

Values can also be used with an initial ! to specify that that specific subset should not be collected.

To avoid collecting even the min subset, specify !all,!min.

To collect only specific facts, use !all,!min, and specify the particular fact subsets.

Default: ["all"]

gather_timeout

integer

Set the default timeout in seconds for individual fact gathering.

Default: 10

Notes

Note

  • More ansible facts will be added with successive releases. If facter is installed, variables from these programs will also be snapshotted into the JSON file for usage in templating. These variables are prefixed with facter_ so it’s easy to tell their source. All variables are bubbled up to the caller.

  • Some facts may be unavailable if running under a limited account.

  • For more information about delegated facts, please check https://docs.ansible.com/ansible/latest/user_guide/playbooks_delegation.html#delegating-facts.

See Also

See also

ansible.windows.setup

Gathers facts about remote hosts.

Examples

- name: run the setup facts
  ansible.windows.setup:

Authors

  • Ansible Core Team