How to preconfigure custom image?

Maybe I missed something when reading through the above, but is there a solution to this?

I would like to build a custom image that will have:

  1. My own OpenVPN setup (with a custom certificate just for this image)
  2. My own custom ~/.ssh/known_hosts

Is there any way to achieve this?