summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/HostingProvider/CloudAtCost.hs
blob: 839aa14e794e41b8f74a72a37c5815f47be0419a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-- | Maintainer: currently unmaintained; your name here!

module Propellor.Property.HostingProvider.CloudAtCost
	{-# WARNING "This module does not have a maintainer. It might not work right anymore. If you use it, please consider becoming its maintainer." #-}
	where

import Propellor.Base
import qualified Propellor.Property.Hostname as Hostname
import qualified Propellor.Property.File as File
import qualified Propellor.Property.User as User

-- Clean up a system as installed by cloudatcost.com
decruft :: Property DebianLike
decruft = propertyList "cloudatcost cleanup" $ props
	& Hostname.sane
	& Hostname.mailname
	& grubbugfix
	& nukecruft
  where
	grubbugfix :: Property DebianLike
	grubbugfix = tightenTargets $ 
		"/etc/default/grub" `File.containsLine` "GRUB_DISABLE_LINUX_UUID=true"
			`describe` "worked around grub/lvm boot bug #743126"
			`onChange` (cmdProperty "update-grub" [] `assume` MadeChange)
			`onChange` (cmdProperty "update-initramfs" ["-u"] `assume` MadeChange)
	nukecruft :: Property Linux
	nukecruft = tightenTargets $
		combineProperties "nuked cloudatcost cruft" $ props
			& File.notPresent "/etc/rc.local"
			& File.notPresent "/etc/init.d/S97-setup.sh"
			& File.notPresent "/zang-debian.sh"
			& File.notPresent "/bin/npasswd"
			& User.nuked (User "user") User.YesReallyDeleteHome