How is it possible to make template task not produce changed:
result if the
before and after only differ in line endings?
I really don't care the line endings in config files on the target hosts, the applications ignores them, but those files can happen to change the line endings w/o changing the other content for various reasons. Thus, when I check those with --check option, I would like them to be considered as ok:
I am aware of
#jinja2: newline_sequence:
inline jinja2 instruction that can be set to either '\n'
or '\r\n'
, but that only converts it one way - you have to stick to what you set while target hosts can have any of them.
My guess is that it can be solved by plugin, which does not seem to be trivial for my python knowledge. I have found this plugin which is close to what I want
https://github.com/berlic/ansibledaily/blob/master/callback_plugins/prediff.py
(It's from the author know here in SO as an experienced ansibler)
But it only can hide the diff log, if I apply I pre-porcess the content for the diff log by eliminating line endings difference, The result still stays changed:
What is the right way to affect the result as well?