you could try using the file resource instead of the template resource (just as a test to make sure chef installs
the file without changing the end of line sequence). If you can install the file using the file resource instead
of the template resource (it may not be as elegant), then this might be a solution.
another idea: install the file using the template resource as you are doing. but install it in an alternative location.
then use ’notifies’ to call a ruby block or command to install the updated file in the new location, but also fixing the
end of line sequence in the process.
This would allow idempotence. Chef would only update the alternative file location if the template changes, and
notifies would only call the “convert and install” process if the template changes.
install /etc/filename.windows using template resource
inside template resource, use: "notifies notifies :run, ‘execute[install_and_fix_file]’”
execute 'install_and_fix_file’ do
command ‘magically_fix_end_of_line < /etc/filename.windows > /etc/filename'
if there is no command you can run on windows to fix the end of line, then you could use a ruby block in a similar way.