diff options
| author | Joey Hess <joey@kitenet.net> | 2014-03-30 02:26:23 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-03-30 02:28:08 -0400 |
| commit | 0039fb6b5623fc7a690fa2a2d3fe20214de236d6 (patch) | |
| tree | a262465f02d245943e943cd91926992660e46713 /HostProp.hs | |
| parent | d50e4dedb20054877916191d66d537defb738667 (diff) | |
property lists
Diffstat (limited to 'HostProp.hs')
| -rw-r--r-- | HostProp.hs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/HostProp.hs b/HostProp.hs index 152ad5a0..494498dc 100644 --- a/HostProp.hs +++ b/HostProp.hs @@ -12,11 +12,11 @@ main :: IO () main = ensureProperties . getProperties =<< getHostName {- This is where the system's HostName, either as returned by uname - - or one specified on the command line is converted into a list of + - or one specified on the command line, is converted into a list of - Properties for that system. -} getProperties :: HostName -> [Property] -getProperties "clam.kitenet.net" = concat - [ cleanCloudAtCost +getProperties hostname@"clam.kitenet.net" = + [ cleanCloudAtCost hostname , standardSystem Apt.Unstable -- Clam is a tor bridge. , Tor.isBridge @@ -30,18 +30,9 @@ getProperties "clam.kitenet.net" = concat --getProperties "foo" = getProperties h = error $ "Unknown host: " ++ h ++ " (perhaps you should specify the real hostname on the command line?)" --- Clean up the system as installed by cloudatcost.com -cleanCloudAtCost :: [Property] -cleanCloudAtCost = - [ User.nuked "user" - , Apt.removed ["exim4"] `onChange` Apt.autoRemove - , Hostname.set "clam.kitenet.net" - , Ssh.uniqueHostKeys - ] - -- This is my standard system setup -standardSystem :: Suite -> [Property] -standardSystem suite = +standardSystem :: Apt.Suite -> Property +standardSystem suite = propertyList "standard system" [ Apt.stdSourcesList suite `onChange` Apt.upgrade , Apt.installed ["etckeeper"] , Apt.installed ["ssh"] @@ -59,3 +50,12 @@ standardSystem suite = , lineInFile "/etc/sudoers" "joey ALL=(ALL:ALL) NOPASSWD:ALL" , GitHome.installedFor "joey" ] + +-- Clean up a system as installed by cloudatcost.com +cleanCloudAtCost :: HostName -> Property +cleanCloudAtCost hostname = propertyList "cloudatcost cleanup" + [ User.nuked "user" + , Apt.removed ["exim4"] `onChange` Apt.autoRemove + , Hostname.set hostname + , Ssh.uniqueHostKeys + ] |
