module Propellor.Property.HostingProvider.Linode where
import Propellor.Base
import qualified Propellor.Property.Grub as Grub
import qualified Propellor.Property.File as File
serialGrub :: Property (HasInfo + DebianLike)
serialGrub = "/etc/default/grub" `File.containsLines`
[ "GRUB_CMDLINE_LINUX=\"console=ttyS0,19200n8\""
, "GRUB_DISABLE_LINUX_UUID=true"
, "GRUB_SERIAL_COMMAND=\"serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1\""
, "GRUB_TERMINAL=serial"
]
`onChange` Grub.mkConfig
`requires` Grub.installed Grub.PC
`describe` "GRUB configured for Linode serial console"
chainPVGrub :: Grub.TimeoutSecs -> Property (HasInfo + DebianLike)
chainPVGrub = Grub.chainPVGrub "hd0" "xen/xvda"
mlocateEnabled :: Property DebianLike
mlocateEnabled = tightenTargets $
"/etc/cron.daily/mlocate"
`File.mode` combineModes (readModes ++ executeModes)