Problem: blockinfile with create=yes creates a file with no ending newline

95 views
Skip to first unread message

Kayvan Sylvan

unread,
Jul 20, 2016, 10:53:18 AM7/20/16
to Ansible Project
Hi everyone,

This snippet:

    # Test blockinfle create
    - name: Testing /tmp/foo
      blockinfile: dest=/tmp/foo create=yes block='My Content'
      become: false

Creates /tmp/foo with no ending newline after the END marker:

$ cat /tmp/foo
# BEGIN ANSIBLE MANAGED BLOCK
My Content
# END ANSIBLE MANAGED BLOCK]

Any suggestions?

---Kayvan

Reply all
Reply to author
Forward
0 new messages