Skip to content

How to create reusable base profile with injected secrets? #275

Answered by jkellerer
Toizi asked this question in Q&A
Discussion options

You must be logged in to vote

@Toizi, just for your info, restic and custom command hooks interpret environment variables, therefore:

[local.env]
  RESTIC_REPOSITORY = "local:some-repo"
  RESTIC_PASSWORD = "1234"
  LOCAL_BACKUP_UUID = "1234"

[local]
  run-before = [
    "echo mount /dev/disk/by-uuid/${LOCAL_BACKUP_UUID} /mnt/backup-{{ .Profile.Name }}"
  ]

does echo (or run if echo is removed):

mount /dev/disk/by-uuid/1234 /mnt/backup-local

See also: https://restic.readthedocs.io/en/latest/040_backup.html#environment-variables

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Toizi
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Toizi
Comment options

You must be logged in to vote
1 reply
@creativeprojects
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants