How to add one empty line to the end of the file in Ansible?
<p>How can I add <strong>one</strong> empty line to the end of a file using <code>lineinfile</code> module in Ansible?</p>

<p>The following adds nothing:</p>

<pre><code>- lineinfile:
    dest: /mypath/myfile
    line: "{{ item }}"
    insertbefore: EOF
  with_items:
  - ""
</code></pre>

<p>The following adds two empty lines (presumably a string <code>\n</code> resolved to an empty line and a default EOL after a string):</p>

<pre><code>- lineinfile:
    dest: /mypath/myfile
    line: "{{ item }}"
    insertbefore: EOF
  with_items:
  - "\n"
</code></pre>