Added get_or_create function for database config.

It should only support ubuntu for now.