foreman_maintain
foreman_maintain copied to clipboard
Backup and restore container gateway postgres DB
Adds backup and restore support for the container gateway DB. Only adds support for the postgres version of the database for now.
One notable change was that the DB commands need to be run as foreman-proxy
since no password is saved for the database. The container gateway uses unix socket auth for the connection, so only the owning user can access the DB (as far as I know).
As such, I've added support for running generic commands as a different user.
To test, try backup and restore on both a normal Foreman/Katello install and on a smart proxy with the container gateway installed.
ToDos:
- [x] Figure out why stderr is ending up in the container gateway database dump
- [x] Write tests