How to change in ansible one line in existing file using template knowing only one line that need to be changed like below.
bar: xxx
The simplest way is to use ansible module lineinfile, but it is not the case. How to do it with template using jinj2 formatting without knowing existing lines contents and prevent their modification.
app.txt - existing file
foo: aaa
bar: bbb
lorem: ccc
app.txt - expected output
foo: aaa
bar: xxx
lorem: ccc