Is there any hack or workaround to do this?
Yes, there is.
According How to do multiline shell script in Ansible
Ansible uses YAML syntax in its playbooks. YAML has a number of block operators ...
the |
character will assign the value Show task name\nDescription: Provides a description of the task\n
to the name
key.
- name: |
Show task name
Descriptipon: Provides a description of the task
debug:
msg: "Hello World!"
tags: multiline
resulting in an output of
TASK [Show task name
Description: Provides a description of the task] ********************************************************************************************************
ok: ...
In respect to the comment
I would like to have it in a title and description format ...
a construct of
- name: |
Show task name]
DESC [Provides a description of the task
debug:
msg: "Hello World!"
tags: multiline
produce an output
TASK [Show task name]
DESC [Provides a description of the task] ********************************************************************************************************
ok: ...
... than giving a multiline detailed name. Having such a big name would take a lot of space in the console
But you are having still multiple lines which takes space in the console and in any case you have to parse it. This would also be true for your initial requirement.