ansible/ansible — pull request #5999 by donspaulding (2014-02-13 19:30:56+00:00)
Title: Insert newline when lineinfile is inserting at EOF, fixes #5825.

In the case that the `regexp` is not found in the `dest` file, lineinfile defaults to adding the `line` at the EOF. If this EOF is not a newline character already, the effect is that lineinfile appends `line` to the last line of the file, which is surprising behavior. This (untested!) change should fix #5825, if you consider #5825 a bug, as I do.