Re: [ansible-project] Lineinfile - Remove line if the regexp match but the variable inside item is not defined.

2022-08-08 Thread Stefan Hornburg (Racke)
On 08/08/2022 14:19, farrukh ahmed wrote: Hello Team, Hope you all are doing well. I'm stuck at lineinfile module. how to check if a variable inside each item is defined then add the line in the file, otherwise if the regex found the match in the remote host file but the variable inside an

[ansible-project] Lineinfile - Remove line if the regexp match but the variable inside item is not defined.

2022-08-08 Thread farrukh ahmed
Hello Team, Hope you all are doing well. I'm stuck at lineinfile module. how to check if a variable inside each item is defined then add the line in the file, otherwise if the regex found the match in the remote host file but the variable inside an item is not defined then remove only that