Re: [ansible-project] Re: how to append to a line keeping

2023-11-08 Thread Sameer Modak
Thanks a lot Todd for making us learn new thing and developing more interest in ansible. Absolute thanks Todd. On Wednesday, November 1, 2023 at 7:12:16 PM UTC+5:30 Todd Lewis wrote: > The short answer is no. If you want to modify the string with backrefs, > then lineinfile will not create the

Re: [ansible-project] Re: how to append to a line keeping

2023-11-01 Thread Todd Lewis
The short answer is no. If you want to modify the string with backrefs, then lineinfile will not create the line if it doesn't exist. But step back and consider your options for managing your override.conf file. A. The best scenario is to take total ownership of the entire file, generating i

[ansible-project] Re: how to append to a line keeping

2023-11-01 Thread Sameer Modak
Hello Team, I could figure out after 10 tries this is how i got it - name: append the line lineinfile: path: /tmp/hello.txt backrefs: yes regexp: '^(.*KAFKA_JMX_OPTS.*)$"'. < line: '\1 -javaagent:{{jmxexporter_jar_path}}={{zookeeper_jmxe