Skip to content

Commit ab30e78

Browse files
sar_facts - improves module return docs (#124) (#125)
(cherry picked from commit 39defcf) Co-authored-by: Nocchia <133043574+NomakCooper@users.noreply.github.com>
1 parent 5002d88 commit ab30e78

1 file changed

Lines changed: 46 additions & 24 deletions

File tree

plugins/modules/sar_facts.py

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -86,34 +86,56 @@
8686
RETURN = r'''
8787
ansible_facts:
8888
description:
89-
- A dictionary containing the SAR data collected. The key is dynamically determined based on the O(type).
90-
- The dict name format is c(sar_<type>).
91-
- The value is a list of dictionaries where each dictionary represents a single data point with the following keys
89+
- A dictionary containing the SAR data collected.
90+
- The value is a list of dictionaries where each dictionary represents a single data point.
9291
- V(date) The date for the measurement.
9392
- V(time) The time for the measurement in 24-hour format.
9493
- Additional keys corresponding to the performance metrics output from the C(sar) command.
9594
returned: always
96-
type: dict
97-
sample: {
98-
"sar_cpu": [
99-
{
100-
"date": "2025-05-01",
101-
"time": "08:00:00",
102-
"AM": "AM",
103-
"%user": "5.00",
104-
"%system": "2.00",
105-
"%idle": "93.00"
106-
},
107-
{
108-
"date": "2025-05-01",
109-
"time": "08:10:00",
110-
"AM": "AM",
111-
"%user": "6.00",
112-
"%system": "3.00",
113-
"%idle": "91.00"
114-
}
115-
]
116-
}
95+
type: complex
96+
contains:
97+
sar_cpu:
98+
description:
99+
- Dictionary that contains C(cpu) data from C(sar).
100+
- It contains V(date), V(time) and all others keys from C(sar) data.
101+
- Most common keys are V(%user), V(%nice), V(%system), V(%idle) and others.
102+
returned: when O(type) is V(cpu).
103+
type: dict
104+
sar_mem:
105+
description:
106+
- Dictionary that contains C(memory) data from C(sar).
107+
- It contains V(date), V(time) and all others keys from C(sar) data.
108+
- Most common keys are V(%memused), V(%commit) and others.
109+
returned: when O(type) is V(memory).
110+
type: dict
111+
sar_swap:
112+
description:
113+
- Dictionary that contains C(swap) data from C(sar).
114+
- It contains V(date), V(time) and all others keys from C(sar) data.
115+
- Most common keys are V(%swpused), V(%swpcad) and others.
116+
returned: when O(type) is V(swap).
117+
type: dict
118+
sar_net:
119+
description:
120+
- Dictionary that contains C(network) data from C(sar).
121+
- It contains V(date), V(time) and all others keys from C(sar) data.
122+
- Most common keys are V(IFACE), V(rxpck/s), V(txpck/s), v(%ifutil) and others.
123+
returned: when O(type) is V(network).
124+
type: dict
125+
sar_disk:
126+
description:
127+
- Dictionary that contains C(disk) data from C(sar).
128+
- It contains V(date), V(time) and all others keys from C(sar) data.
129+
- Most common keys are V(DEV), V(%util), V(await), V(rkB/s), V(wkB/s) and others.
130+
returned: when O(type) is V(disk).
131+
type: dict
132+
sar_load:
133+
description:
134+
- Dictionary that contains C(load) data from C(sar).
135+
- It contains V(date), V(time) and all others keys from C(sar) data.
136+
- Most common keys are V(ldavg-1), V(ldavg-5), V(ldavg-15) and others.
137+
returned: when O(type) is V(load).
138+
type: dict
117139
'''
118140

119141
from ansible.module_utils.basic import AnsibleModule

0 commit comments

Comments
 (0)