Ansible "block" error

How do I troubleshoot the Ansible Error “block is not a valid attribute for a Play”? Or, is there a better attribute to use here?

Ansible Version:

ansible 2.9.18
config file = /etc/ansible/ansible.cfg
configured module search path = [u’/home/keith/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Nov 16 2020, 22:23:17) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]

Playbook:

How do I troubleshoot the Ansible Error “block is not a valid attribute for a Play”? Or, is there a better attribute to
use here?

Your code in your playbook should be inside "tasks:".

Regards
         Racke

Ansible Version:

ansible 2.9.18
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/keith/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Nov 16 2020, 22:23:17) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]

Playbook:

---

- 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\(' '\) 

}}"