why debug is considered as task and needs - while other can run under single -name

When i execute below code it does not run it give error.

hosts: all
tasks:

  • name: “show version”
    setup: filter=“*version”
  • name: “status of service”
    shell: “/usr/sbin/service auditd status”
  • name: “register demo”
    shell: cat /etc/redhat-release
    register: release
    debug: msg="this is time {{ release.stdout }} " ---->> ti does not run

‘debug’ isn’t considered a task, it actually IS one. So you’d have to indent it as such.

It’s not some property or a parameter of another task, it’s a real task on its own.

Dick