Ansible – Print message – debug: msg=”line1 \n {{ var2 }} \n line3 with var3 = {{ var3 }}”
debug module support array, so you can do like this: debug: msg: – “First line” – “Second line” The output: ok: [node1] => { “msg”: [ “First line”, “Second line” ] } Or you can use the method from this answer: In YAML, how do I break a string over multiple lines?