file.append(append/prepend_if_not_found)

file.blockreplace already has append/prepend if not found.

No reason the simple file.replace should not have the same mechanism to
edit configuration file.

If that PR gets merged, similar functions should be added to state.file
later.

Any suggestion about not_found_content param name ?