Provide backup/restore actions

Bug #1842152 reported by Andrea Ieri
18
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/juju/agents/unit-<unit name>/charm/EasyRSA/pki but I'm not sure if it's just a matter of saving and restoring that directory.

George Kraft (cynerva)
Changed in charm-easyrsa:
importance: Undecided → Wishlist
status: New → Triaged
Changed in charm-easyrsa:
assignee: nobody → Martin Kalcok (martin-kalcok)
status: Triaged → In Progress
Revision history for this message
Martin Kalcok (martin-kalcok) wrote :

I would approach this by creating 4 actions for easyrsa charm:

* backup
* restore name=<backup_file_name>
* list-backups
* delete-backup name=<backup_file_name> [all=no]

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:
This action creates snapshot of pki and stores it in predefined location (/home/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.
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://github.com/juju-solutions/layer-debug

Restore action:
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/ubuntu/easyrsa_backups' first, using 'juju scp'.

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.

Revision history for this message
Alvaro Uria (aluria) wrote :
tags: added: review-needed
George Kraft (cynerva)
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.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.