Provide backup/restore actions
Bug #1842152 reported by
Andrea Ieri
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EasyRSA Charm |
Fix Released
|
Wishlist
|
Martin Kalcok |
Bug Description
There is currently no charmed way to backup/restore an easyrsa installation.
Stateful data lives in /var/lib/
Changed in charm-easyrsa: | |
importance: | Undecided → Wishlist |
status: | New → Triaged |
Changed in charm-easyrsa: | |
assignee: | nobody → Martin Kalcok (martin-kalcok) |
status: | Triaged → In Progress |
Changed in charm-easyrsa: | |
status: | In Progress → Fix Committed |
tags: | removed: review-needed |
Changed in charm-easyrsa: | |
milestone: | none → 1.20 |
Changed in charm-easyrsa: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I would approach this by creating 4 actions for easyrsa charm:
* backup file_name> file_name> [all=no]
* restore name=<backup_
* list-backups
* delete-backup name=<backup_
Caveat: From what I gathered, the `juju run-action` is not designed to transport files between local and target system, so these action will need to be used in conjunction with `juju scp`.
Backup action: ubuntu/ easyrsa_ backups/ ) into the timestamped archive (easyrsa- backup- YYYYMMDD- HHMMSS. tar.gz) . The archive will contain 'pki' directory from $CHARM_DIR/EasyRSA/ which should contain all the required data needed for backup. I'm currently investigating whether also $CHARM_ DIR/.unit- state.db needs to be backed up or if it can be restored purely based on data from pki directory. /github. com/juju- solutions/ layer-debug
This action creates snapshot of pki and stores it in predefined location (/home/
When the backup is created, output of the action will contain 'juju scp' command that user can use to copy the backup file to the local machine. Similar to how debug action works in https:/
Restore action: ubuntu/ easyrsa_ backups' first, using 'juju scp'.
This action takes one parameter 'name', looks for the backup file with that name in the backup directory and restores the easyrsa pki.
If user wants to restore pki from the backup file located on the local machine. It will have to be uploaded to the '/home/
List action:
Lists all the files in the backup directory
Delete action:
This action takes either parameter 'name' and attempts to delete file with that name from the backup folder, or if parameter 'all=yes' is used, all backups in the directory will be deleted.