I am new to Ansible and my play looks like this:
- name: "Spark Submit Command"
shell: "{{ sparkCommand }}"
register: spark_output
- debug: msg="{{ spark_output.stdout }}"
I have around 60 lines in my spark_output.stdout and getting the output as below:
ok: [DHADLX110] => {
"msg": "Line1\nLine2\nLine3...........Line.."
Is it possible to print these line by line or in a proper dialog box? Something similar to below format:
Line1
Line2
.
.
.
Line60
When you register command output, Ansible will give you
stdout
andstdout_lines
.If you change your debug task to:
You will see that it also returns
stdout_lines
. So instead ofspark_output.stdout
use: