setup module
The module that collects facts about a host, such as its operating system, memory and network addresses.
In more detail
Fact gathering at the start of a play runs this module for you, which is why a play shows a Gathering Facts task you did not write. Run on its own with -a filter=<pattern> it shows matching facts, and a star at the end of a pattern selects a family of facts. It only looks, so it always reports unchanged.
Example
ansible all -m ansible.builtin.setup -a filter=ansible_systemRelated terms
- fact — A variable Ansible discovers about a host itself, such as its operating system, host name, memory or network addresses.
- fact gathering — The automatic first step of a play that runs the setup module on every host to collect its facts.
- ad hoc command — A single Ansible module run against a set of hosts straight from the command line, without writing a playbook.
Taught in
- Installing Ansible — Ansible Configuration Management at Scale
- Your First Ad Hoc Command — Ansible Configuration Management at Scale
- Gathering Facts — Ansible Configuration Management at Scale
- Facts And Magic Variables: Let Each Node Describe Itself — RHCE in Ansible (EX294): Automate Red Hat Systems
- Storage: Partitions, Volume Groups And Volumes Where The Disk Exists — RHCE in Ansible (EX294): Automate Red Hat Systems