foremanctl backup/restore
Hello community,
Lately I’ve been working out some of the specifics about how foreman-maintain commands should look in foremanctl. My first post around this is here: (3) Foreman-maintain functionality report for foremanctl port - Development - TheForeman.
In this post I’d like to update you all on backup and restore, which could be considered one of the most complicated pieces of foreman-maintain. @sajha has just begun implementing offline backup of databases only in foremanctl following this plan.
General approach
foremanctl backup/restore are new commands that closely follow foreman-maintain backup/restore. foreman-maintain’s general backup/restore functionality is proposed to be ported to foremanctl.
Implementation steps
- Offline database backup
- Offline config file backup
- Offline Pulp backup (optional)
- Restore, which is agnostic to the backup style
- Online backup
- Incremental backup
- I propose to use
tar --listed-incrementalfrom the start to reduce effort here
- I propose to use
- Backup/restore of smart proxies
- Container gateway DB backup will be a major part of this
And, along the way, documentation is updated/created as needed.
High-Level Design
- Follow the same logical steps as foreman-maintain to orchestrate backup/restore.
- Use existing Ansible functionality and architecture to avoid rewriting the low-level functionality, like grabbing postgres dumps and copying files around.
- Rely on
foremanctl deployas much as possible to restore the machine. - Regenerate podman secrets from foremanctl context, like
parameters.yaml. - Data backed up is conditional based on what features or flavors are in use.
- Use metadata.yml like before to save information about the backup
- Can include details like hostname, foremanctl version, backup type, enabled features, container image inventory
- backup and restore are playbooks exposed as CLI options via obsah
- Preflight checks for operations that will error out if issues are detected
I wanted to keep this design as unsurprising as possible by keeping concepts from foreman-maintain and by following design principals already in foremanctl today.
I have more public design specifics on Jira, which I’m happy to discuss here.