-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Win lineinfile fix #35100
Win lineinfile fix #35100
Conversation
The changes seem good to me but it would be good if you could add in
I know this will probably break people's playbooks but the changes you have here is arguably what they should be doing so once we have expanded the above I'm good to merge. |
CI failure in integration tests: https://app.shippable.com/github/ansible/ansible/runs/54327/9/tests |
Sorry for delays, been pretty busy at work. Added documentation and some additional testing per request. LMK if you want any changes. |
@nwsparks sorry I hadn't looked at this earlier, looks good to me and I'll add to the 2.5 blocker list in case there is a new RC being released. rebuild_merge |
@jborean93 no problem, thanks for the review. |
* win_lineinfile: fix ansible#33858. Removed conversion from \r\n * win_lineinfile: added test for ansible#33858 * win_lineinfile: added documentation and more tests for change * win_lineinfile: fixed wrong hash in testing (cherry picked from commit e15a903)
Backport PR for the stable-2.5 release is here #36888 |
* Win lineinfile fix (#35100) * win_lineinfile: fix #33858. Removed conversion from \r\n * win_lineinfile: added test for #33858 * win_lineinfile: added documentation and more tests for change * win_lineinfile: fixed wrong hash in testing (cherry picked from commit e15a903) * Added changelog for win_lineinfile fix * fix typo in changelog
SUMMARY
Fixes #33858
Added test for this particular issue
Updated the copyright headers
ISSUE TYPE
COMPONENT NAME
win_lineinfile
ANSIBLE VERSION
ADDITIONAL INFORMATION
win_lineinfile had a section which was converting
\r\n
to`r`n`
which is the PowerShell method of inserting line breaks. This was causing things like some windows paths (ex. c:\return\new) to be inserted incorrectly.After removing the section, if line breaks are desired they can still be done
path: "break\r\nhere"
. The quoting is important.Any conversions are occurring in Ansible prior to being processed by PowerShell. So things like
path: "break`r`nhere"
are interpreted literally by powershell and no line break will occur.