I have a list of lines I want to add to a file on the target system if they 
don't exist.  I don't want to wholesale overwrite the file, and I don't 
want to write dozens of lineinfile: statements.

Is it possible to do the equivalent of:

while read line; do
  if grep "$line" /target/file >/dev/null 2>&1 ; then : ; else echo $line 
>> /target/file; fi
done < /source/file

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/30bd7ab2-0c90-47fa-b343-160e8c78b2fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to