We prefer to use a wrapper script to do this rather than `inreplace`. See `ansible.rb` for a good example.