Ansible echo into file
<p>I'm struggling with some Ansible/YAML syntax here. How do I echo multiple lines (in append mode) in to a file? I also can't use the copy module (with the content arg) because it has to be appended.</p>

<p>This code:</p>

<pre><code>- name: Write backup script for each app
  shell: echo | '
      line one
      line two
      line three
      ' &gt;&gt; /manager/backup.sh
</code></pre>

<p>errors out with nonsensical:</p>

<pre><code>"stderr": "/bin/sh:  line one line two line three : command not found"
</code></pre>

<p>I'm using the pipe because I think it's how you tell Ansible you want multiple lines (with preserved formatting), but maybe it's being used as a shell pipe.</p>