Replace the whole file with template or file module, then you know that file will be correct.
If you don't want to do that you can use lineinfile module to replace line(s).
Replace the whole file with template or file module, then you know that file will be correct.
If you don't want to do that you can use lineinfile module to replace line(s).