propellor spin
This commit is contained in:
parent
eb71c76711
commit
7a0074454b
|
@ -58,3 +58,13 @@ fileProperty desc a f = Property desc $ go =<< doesFileExist f
|
|||
dirExists :: FilePath -> Property
|
||||
dirExists d = check (not <$> doesDirectoryExist d) $ Property (d ++ " exists") $
|
||||
makeChange $ createDirectoryIfMissing True d
|
||||
|
||||
-- | Ensures that a file/dir has the specified owner and group.
|
||||
ownerGroup :: FilePath -> UserName -> GroupName -> Property
|
||||
ownerGroup f owner group = Property (f ++ " owner " ++ og) $ do
|
||||
r <- ensureProperty $ cmdProperty "chown" [og, f]
|
||||
if r == FailedChange
|
||||
then return r
|
||||
else noChange
|
||||
where
|
||||
og = owner ++ ":" ++ group
|
||||
|
|
|
@ -22,7 +22,8 @@ daemonRunning exportdir = RevertableProperty setup unsetup
|
|||
`requires`
|
||||
Apt.serviceInstalledRunning "openbsd-inetd"
|
||||
`onChange`
|
||||
Service.reloaded "openbsd-inetd"
|
||||
Service.running "openbsd-inetd"
|
||||
`describe` ("git-daemon exporting " ++ exportdir)
|
||||
unsetup = lacksLine conf (mkl "tcp4")
|
||||
`requires`
|
||||
lacksLine conf (mkl "tcp6")
|
||||
|
|
|
@ -4,6 +4,7 @@ import Data.Monoid
|
|||
import System.Console.ANSI
|
||||
|
||||
type HostName = String
|
||||
type GroupName = String
|
||||
type UserName = String
|
||||
|
||||
data Property = Property
|
||||
|
|
|
@ -67,6 +67,7 @@ host hostname@"diatom.kitenet.net" = Just $ props
|
|||
& Apt.installed ["git", "git-annex", "rsync"]
|
||||
& Apt.buildDep ["git-annex"] `period` Daily
|
||||
& Git.daemonRunning "/srv/git"
|
||||
& File.ownerGroup "/srv/git" "joey" "joey"
|
||||
-- git repos restore (how?)
|
||||
-- kgb installation and setup
|
||||
-- ssh keys for branchable and github repo hooks
|
||||
|
|
Loading…
Reference in New Issue