- name: Get diagnostic info block
block:
- name: Get top process diagnostic info
script: library/diag_top_processes.ps1
failed_when: false
changed_when: false
register: diag_top_proc_out
\- name: Get memory and pagefile usage diagnostic info
script: library/diag\_memory\_and\_pagefile\.ps1
failed\_when: false
changed\_when: false
register: diag\_mem\_page\_out
\- name: Get CPU info
script: library/diag\_cpu\_info\.ps1
failed\_when: false
changed\_when: false
register: diag\_cpu\_info\_out
\- name: Init diag message
set\_fact:
diag\_msg: "Diagnostic information:"
proc\_info:
"\{\{ diag\_top\_proc\_out\.stdout|regex\_replace\('\\r\\n|\\n|\\r', ''\) \}\}"
cpu\_info: "\{\{ diag\_cpu\_info\_out\.stdout\_lines | join\(' '\) \}\}"
\- name: Add top process info
set\_fact:
diag\_msg: "\{\{ \[diag\_msg, proc\_info\] | join\(' '\) \}\}"
\- name: Add memory info
set\_fact:
diag\_msg:
"\{\{ \[diag\_msg, diag\_mem\_page\_out\.stdout\_lines\[0\]\] | join\(' '\) \}\}"
\- name: Add CPU info
set\_fact:
diag\_msg:
"\{\{ \[diag\_msg, cpu\_info\] | join\(' '\)