lineinfile - append at end of line
groups.google.com › g › ansible-projectSep 30, 2013 · here is a simplified l example of a configuration file that has a line. starting with something like. OPTIONS="-a option1 -b another:option -x -z athird.option". the point is to check if -x is NOT there and add it as the first option (could have been added at the end by swapping -x and \\1) lineinfile: dest=$ {target_file}