python - Not able to remove a specific character from file via ansible -
i have file below data
server1 10.10.10.10, server2 10.10.10.20, server3 10.10.10.30,
and delete comma character(,
) third line i.e server3 10.10.10.30.
when try use lineinfile
method, removes commas, requirement remove comma third line.
i wondering if there method can use in ansible remove character line x, row y more precise?
thank in advance time , response.
the lineinfile
module not seem appropriate scenario. instead use sed
command:
- shell: sed -i 3s/,$// filetochange
Comments
Post a Comment