From 900fec76cdbd24a3c3f4304198dd4afd9a87c8d3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 9 Oct 2018 09:38:52 -0400 Subject: Borg: Added UsesEnvVar. For eg, BORG_REMOTE_PATH needed to use borg on rsync.net This commit was sponsored by Jochen Bartl on Patreon. --- debian/changelog | 1 + src/Propellor/Property/Borg.hs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/debian/changelog b/debian/changelog index 225b71b0..cc0e0a15 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,7 @@ propellor (5.5.0) UNRELEASED; urgency=medium This fixes a potential ordering problem; the property used to append the line to /etc/sudoers, but that would override more specific lines in the include directory. + * Borg: Added UsesEnvVar. -- Joey Hess Thu, 09 Aug 2018 10:54:41 -0400 diff --git a/src/Propellor/Property/Borg.hs b/src/Propellor/Property/Borg.hs index dab07985..9d49fdf4 100644 --- a/src/Propellor/Property/Borg.hs +++ b/src/Propellor/Property/Borg.hs @@ -36,6 +36,9 @@ data BorgRepoOpt -- | Use to specify a ssh private key to use when accessing a -- BorgRepo. = UseSshKey FilePath + -- | Use to specify an environment variable to set when running + -- borg on a BorgRepo. + | UsesEnvVar (String, String) repoLoc :: BorgRepo -> String repoLoc (BorgRepo s) = s @@ -53,6 +56,7 @@ runBorgEnv (BorgRepo _) = [] runBorgEnv (BorgRepoUsing os _) = map go os where go (UseSshKey k) = ("BORG_RSH", "ssh -i " ++ k) + go (UsesEnvVar (k, v)) = (k, v) installed :: Property DebianLike installed = withOS desc $ \w o -> case o of -- cgit v1.2.3