set_stats
Define and aggregate custom statistics for a playbook run
Collection: builtin
Full Name: set_stats
Aliases: ansible.builtin.set_stats, parallax.builtin.set_stats
Controller module — runs on the local controller, not on remote hosts.
Synopsis
Define and aggregate custom statistics for a playbook run
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| data | dict | Dictionary of custom statistics to record | ||
| per_host | bool | false | Record statistics for the current host instead of the run | |
| aggregate | bool | true | Aggregate each statistic instead of replacing its value |
Example
yaml
- name: Count processed records
ansible.builtin.set_stats:
data:
records_processed: 12
per_host: true