So I got the following task:
- name: "Use echo."
shell: echo -e "First Line\n " > "/tmp/{{ ansible_date_time.date }}_test.txt"
delegate_to: localhost
become: 'no'
changed_when: 'false'
run_once: 'yes'
When looking at the resulting file I get:
-e First Line
<newline printed properly>
What I want is:
First Line
<newline printed properly>
I basically tried every form of quoting, so what am I missing?
echo
accepts only-n
, not-e
(it will process\n
anyway) – muru Oct 07 '20 at 08:47