I have a playbook as shown below:
- hosts: localhost
tasks:
- name: update a file
blockinfile:
dest: /tmp/test
block: |
line 1
line 2
Upon running the playbook, the file /tmp/test becomes:
a # this is the end line of the original file
# BEGIN ANSIBLE MANAGED BLOCK
line 1
line 2
# END ANSIBLE MANAGED BLOCK
I would like to add a blank line (newline) before the marker "# BEGIN ANSIBLE MANAGED BLOCK" for visual effect, what is the easiest way to do it? Preferably within the task, but any idea is welcome. If I redefine the marker, it will affect both the "BEGIN" and "END" marker.