On 29.05.2017 16:26, Listing wrote:
> Hi Kai,
>
> Thank you for your reply. But what is the difference then between
> regexp
> and insertafter etc? Is regexp always being replaced? Or what is
> exactly
> the logic?
regexp: and insertafter: is separate features in lineinfile.
When lineinfile find the regexp in regexp: it replaces this line with
the string in line:
If it can't find the regexp in regexp: the sting in line: is append to
end of file(EOF).
When lineinfile find the regexp in insertafter: it add the string in
line: after this line, if it's not already exist.
If it can't find the regexp in insertafter: the string in line: is
append to end of file(EOF).
These two feature is not meant to be combine in one task, but used in
separate tasks.
--
Kai Stian Olstad