Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
content argument of copy module doesn't add end of line character #7855
When using content='blah' for a file, the file will have 'blah' with no end of line character, which is generally an invalid file.
Steps To Reproduce:
- name: Add world to /tmp/hello copy: dest=/tmp/hello content='world'
The content is verbatum, so just add a '\n' to it if you want a newline. Files without newlines are not "generally invalid", as there are plenty of config files that do not end with a newline. If you have any further questions regarding this, please let us know. Thanks!
POSIX states that text files should end with a newline to specify end of file. It might be a problem for this to be the default for people writing binary into their files via content (do people actually do this?) but for the vast majority of cases the module is likely writing POSIX in-compliant files.