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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -