Windows: Use the correct newline sequence for the platform (#21846)

This change to the template action plugin make template use the
platform's native newline_sequence for Jinja.

We also added the option `newline_sequence` to change the newline
sequence using by Jinja if you need to use another newline sequence than
the platform default.

This was previously discussed in
https://github.com/ansible/ansible/issues/16255#issuecomment-278289414

And also relates to issue #21128
This commit is contained in:
Dag Wieers 2017-03-24 03:47:10 +01:00 committed by Matt Davis
parent ef36d7de68
commit ac43a1bbbc
16 changed files with 381 additions and 71 deletions

View file

@ -26,4 +26,4 @@ from ansible.plugins.action.template import ActionModule as TemplateActionModule
# Even though TemplateActionModule inherits from ActionBase, we still need to
# directly inherit from ActionBase to appease the plugin loader.
class ActionModule(TemplateActionModule, ActionBase):
pass
DEFAULT_NEWLINE_SEQUENCE = '\r\n'