propellor spin
This commit is contained in:
parent
0e0a70f794
commit
69eb566e0b
|
@ -71,6 +71,10 @@ securityUpdates suite
|
||||||
stdSourcesList :: DebianSuite -> Property
|
stdSourcesList :: DebianSuite -> Property
|
||||||
stdSourcesList suite = stdSourcesList' suite []
|
stdSourcesList suite = stdSourcesList' suite []
|
||||||
|
|
||||||
|
-- | Adds additional sources.list generators.
|
||||||
|
--
|
||||||
|
-- Note that if a Property needs to enable an apt source, it's better
|
||||||
|
-- to do so via a separate file in /etc/apt/sources.list.d/
|
||||||
stdSourcesList' :: DebianSuite -> [SourcesGenerator] -> Property
|
stdSourcesList' :: DebianSuite -> [SourcesGenerator] -> Property
|
||||||
stdSourcesList' suite more = setSourcesList
|
stdSourcesList' suite more = setSourcesList
|
||||||
(concatMap (\gen -> gen suite) generators)
|
(concatMap (\gen -> gen suite) generators)
|
||||||
|
@ -81,6 +85,11 @@ stdSourcesList' suite more = setSourcesList
|
||||||
setSourcesList :: [Line] -> Property
|
setSourcesList :: [Line] -> Property
|
||||||
setSourcesList ls = sourcesList `File.hasContent` ls `onChange` update
|
setSourcesList ls = sourcesList `File.hasContent` ls `onChange` update
|
||||||
|
|
||||||
|
setSourcesListD :: [Line] -> FilePath -> Property
|
||||||
|
setSourcesListD ls basename = f `File.hasContent` ls `onChange` update
|
||||||
|
where
|
||||||
|
f = "/etc/apt/sources.list.d/" ++ basename
|
||||||
|
|
||||||
runApt :: [String] -> Property
|
runApt :: [String] -> Property
|
||||||
runApt ps = cmdProperty' "apt-get" ps noninteractiveEnv
|
runApt ps = cmdProperty' "apt-get" ps noninteractiveEnv
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,6 @@ import Utility.SafeCommand
|
||||||
|
|
||||||
import Data.List
|
import Data.List
|
||||||
|
|
||||||
installed :: Property
|
|
||||||
installed = Apt.installed ["obnam"]
|
|
||||||
|
|
||||||
type ObnamParam = String
|
type ObnamParam = String
|
||||||
|
|
||||||
-- | An obnam repository can be used by multiple clients. Obnam uses
|
-- | An obnam repository can be used by multiple clients. Obnam uses
|
||||||
|
@ -95,17 +92,21 @@ restored dir params = Property (dir ++ " restored by obnam") go
|
||||||
, return FailedChange
|
, return FailedChange
|
||||||
)
|
)
|
||||||
|
|
||||||
-- | apt sources.list lines for obnam.
|
installed :: Property
|
||||||
--
|
installed = Apt.installed ["obnam"]
|
||||||
-- Only adds anything for Stable; use in order to get a newer version of
|
|
||||||
-- obnam than is is Stable.
|
|
||||||
aptSources :: Apt.SourcesGenerator
|
|
||||||
aptSources Stable = ["deb http://code.liw.fi/debian wheezy main"]
|
|
||||||
aptSources _ = []
|
|
||||||
|
|
||||||
-- | Key used by the code.liw.fi repository.
|
-- | Ensures that a recent version of obnam gets installed.
|
||||||
aptKey :: Apt.AptKey
|
--
|
||||||
aptKey = Apt.AptKey "obnam" $ unlines
|
-- Only useful on Stable.
|
||||||
|
latestVersion :: Property
|
||||||
|
latestVersion = propertyList "obnam latest version"
|
||||||
|
[ toProp $ Apt.trustsKey key
|
||||||
|
, Apt.setSourcesListD sources "obnam"
|
||||||
|
]
|
||||||
|
where
|
||||||
|
sources = ["deb http://code.liw.fi/debian wheezy main"]
|
||||||
|
-- gpg key used by the code.liw.fi repository.
|
||||||
|
key = Apt.AptKey "obnam" $ unlines
|
||||||
[ "-----BEGIN PGP PUBLIC KEY BLOCK-----"
|
[ "-----BEGIN PGP PUBLIC KEY BLOCK-----"
|
||||||
, "Version: GnuPG v1.4.9 (GNU/Linux)"
|
, "Version: GnuPG v1.4.9 (GNU/Linux)"
|
||||||
, ""
|
, ""
|
||||||
|
|
|
@ -50,7 +50,8 @@ kgbServer = withOS desc $ \o -> case o of
|
||||||
-- git.kitenet.net and git.joeyh.name
|
-- git.kitenet.net and git.joeyh.name
|
||||||
gitServer :: [Host] -> Property
|
gitServer :: [Host] -> Property
|
||||||
gitServer hosts = propertyList "git.kitenet.net setup"
|
gitServer hosts = propertyList "git.kitenet.net setup"
|
||||||
[ Obnam.backup "/srv/git" "33 3 * * *"
|
[ Obnam.latestVersion
|
||||||
|
, Obnam.backup "/srv/git" "33 3 * * *"
|
||||||
[ "--repository=sftp://joey@turtle.kitenet.net/~/lib/backup/git.kitenet.net.obnam"
|
[ "--repository=sftp://joey@turtle.kitenet.net/~/lib/backup/git.kitenet.net.obnam"
|
||||||
, "--encrypt-with=1B169BE1"
|
, "--encrypt-with=1B169BE1"
|
||||||
, "--client-name=wren"
|
, "--client-name=wren"
|
||||||
|
|
|
@ -19,7 +19,6 @@ import qualified Propellor.Property.Docker as Docker
|
||||||
import qualified Propellor.Property.Git as Git
|
import qualified Propellor.Property.Git as Git
|
||||||
import qualified Propellor.Property.Apache as Apache
|
import qualified Propellor.Property.Apache as Apache
|
||||||
import qualified Propellor.Property.Postfix as Postfix
|
import qualified Propellor.Property.Postfix as Postfix
|
||||||
import qualified Propellor.Property.Obnam as Obnam
|
|
||||||
import qualified Propellor.Property.SiteSpecific.GitHome as GitHome
|
import qualified Propellor.Property.SiteSpecific.GitHome as GitHome
|
||||||
import qualified Propellor.Property.SiteSpecific.GitAnnexBuilder as GitAnnexBuilder
|
import qualified Propellor.Property.SiteSpecific.GitAnnexBuilder as GitAnnexBuilder
|
||||||
import qualified Propellor.Property.SiteSpecific.JoeySites as JoeySites
|
import qualified Propellor.Property.SiteSpecific.JoeySites as JoeySites
|
||||||
|
@ -172,9 +171,7 @@ gitAnnexBuilder arch buildminute = Docker.container (arch ++ "-git-annex-builder
|
||||||
standardSystem :: HostName -> DebianSuite -> Architecture -> Host
|
standardSystem :: HostName -> DebianSuite -> Architecture -> Host
|
||||||
standardSystem hn suite arch = host hn
|
standardSystem hn suite arch = host hn
|
||||||
& os (System (Debian suite) arch)
|
& os (System (Debian suite) arch)
|
||||||
& Apt.trustsKey Obnam.aptKey
|
& Apt.stdSourcesList suite
|
||||||
& Apt.stdSourcesList' suite
|
|
||||||
[ Obnam.aptSources ]
|
|
||||||
`onChange` Apt.upgrade
|
`onChange` Apt.upgrade
|
||||||
& Apt.installed ["etckeeper"]
|
& Apt.installed ["etckeeper"]
|
||||||
& Apt.installed ["ssh"]
|
& Apt.installed ["ssh"]
|
||||||
|
|
Loading…
Reference in New Issue