module Propellor.Property.HostingProvider.Exoscale (
distroKernel,
) where
import Propellor.Base
import qualified Propellor.Property.File as File
import qualified Propellor.Property.Grub as Grub
import qualified Propellor.Property.Apt as Apt
import qualified Propellor.Property.Reboot as Reboot
type KernelFlavor = String
distroKernel :: KernelFlavor -> Property DebianLike
distroKernel kernelflavor = go `flagFile` theFlagFile
where
go = combineProperties "boots distro kernel" $ props
& Apt.installed ["grub2", "linux-image-" ++ kernelflavor]
& Grub.boots "/dev/vda"
& Grub.mkConfig
& File.hasContent theFlagFile [""]
& Reboot.toDistroKernel
theFlagFile = "/etc/propellor-distro-kernel"