diff options
| author | Evan Cofsky <evan@theunixman.com> | 2016-02-26 10:20:21 -0600 |
|---|---|---|
| committer | Evan Cofsky <evan@theunixman.com> | 2016-03-07 13:31:51 -0600 |
| commit | 822694e790102efa2a5bb4a0c3d62c6fce1d4e87 (patch) | |
| tree | 833ade451e379c641e9cf5de46cc81d02d8fefbc /src/Propellor/CmdLine.hs | |
| parent | e8f36722bf23a19dcdd42a1c14ebaa40a2d73293 (diff) | |
FreeBSD Support including:
- Propellor bootstrapping
- Basic pkg
- Basic ZFS datasets and properties
- Simple Poudriere configuration (regular and ZFS)
- Poudriere jail creation
FIXME:
- Cron.hs: runPropellor needs the System, but hasn't yet gotten it.
Reorganizing:
- Remove FreeBSD.Process
- Move ZFS up to Property
- Add Info for Pkg.update/Pkg.upgrade
- Move FreeBSD.md to doc so it'll show up automatically.
- Merge the FreeBSD config with the other sample config.
- Use Info to check Pkg updated/upgraded and Poudriere configured.
- Warnings clean-up, move ZFS types to Propellor.Types.
- Maintainer and license statements.
Diffstat (limited to 'src/Propellor/CmdLine.hs')
| -rw-r--r-- | src/Propellor/CmdLine.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index 5dbc5836..1761a11e 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -21,7 +21,7 @@ import qualified Propellor.Property.Chroot as Chroot import qualified Propellor.Shim as Shim usage :: Handle -> IO () -usage h = hPutStrLn h $ unlines +usage h = hPutStrLn h $ unlines [ "Usage:" , " propellor" , " propellor hostname" @@ -47,10 +47,10 @@ usageError ps = do processCmdLine :: IO CmdLine processCmdLine = go =<< getArgs where - go ("--check":_) = return Check + go ("--check":_) = return Check go ("--spin":ps) = case reverse ps of - (r:"--via":hs) -> Spin - <$> mapM hostname (reverse hs) + (r:"--via":hs) -> Spin + <$> mapM hostname (reverse hs) <*> pure (Just r) _ -> Spin <$> mapM hostname ps <*> pure Nothing go ("--add-key":k:[]) = return $ AddKey k @@ -62,7 +62,7 @@ processCmdLine = go =<< getArgs go ("--edit":f:c:[]) = withprivfield f c Edit go ("--list-fields":[]) = return ListFields go ("--merge":[]) = return Merge - go ("--help":_) = do + go ("--help":_) = do usage stdout exitFailure go ("--boot":_:[]) = return $ Update Nothing -- for back-compat @@ -134,7 +134,7 @@ defaultMain hostlist = withConcurrentOutput $ do withhost :: HostName -> (Host -> IO ()) -> IO () withhost hn a = maybe (unknownhost hn hostlist) a (findHost hostlist hn) - + runhost hn = onlyprocess $ withhost hn mainProperties onlyprocess = onlyProcess (localdir </> ".lock") @@ -205,5 +205,5 @@ hostname s = go =<< catchDefaultIO [] dnslookup go (AddrInfo { addrCanonName = Just v } : _) = pure v go _ | "." `isInfixOf` s = pure s -- assume it's a fqdn - | otherwise = + | otherwise = error $ "cannot find host " ++ s ++ " in the DNS" |
