ansible.windows.setup (2.3.0) — module

Gathers facts about remote hosts

Authors: Ansible Core Team

Install collection

Install with ansible-galaxy collection install ansible.windows:==2.3.0


Add to requirements.yml

  collections:
    - name: ansible.windows
      version: 2.3.0

Description

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 C(/usr/bin/ansible) to check what variables are available to a host. Ansible provides many I(facts) about the system, automatically.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: run the setup facts
  ansible.builtin.setup:

Inputs

    
fact_path:
    description:
    - Path used for local ansible facts (C(*.ps1) or C(*.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. C(ansible_my_fact).
    type: path

gather_subset:
    default: all
    description:
    - 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 C(!) to specify that that specific subset
      should not be collected.
    - To avoid collecting even the min subset, specify C(!all,!min).
    - To collect only specific facts, use C(!all,!min), and specify the particular fact
      subsets.
    elements: str
    type: list

gather_timeout:
    default: 10
    description:
    - Set the default timeout in seconds for individual fact gathering.
    type: int

_measure_subset:
    default: false
    description:
    - For internal use
    type: bool

See also