* Change test suite to fit expected behaviour
This reverts some changes from ansible/ansible@723daf3
If a line is found in the file, exactly or via regexp matching, it must
not be added again.
insertafter/insertbefore options are used only when a line is to be
inserted, to specify where it must be added.
(cherry picked from commit 31c11de2af)
(cherry picked from commit eb92ce3d6f)
* Implement the change in behaviour mentioned in the previous commit
(cherry picked from commit a4141cfa2e)
(cherry picked from commit 6afe25d93e)
* Fix comment to reflect what the code does
(cherry picked from commit 150f5cb232)
(cherry picked from commit 1a13bf06a3)
* Set the correct return message.
In these cases, the lines are added, not replaced.
(cherry picked from commit 3216c31401)
(cherry picked from commit 5bd04bd5d5)
* Add a changelog
(cherry picked from commit c39cf6b332)
(cherry picked from commit fc071636b4)
- "This reverts some changes from commit 723daf3. If a line is found in the file, exactly or via regexp matching, it must not be added again. `insertafter`/`insertbefore` options are used only when a line is to be inserted, to specify where it must be added."