summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/HostingProvider
diff options
context:
space:
mode:
authorSean Whitton2016-06-12 09:47:23 +0900
committerSean Whitton2016-06-12 09:47:23 +0900
commite20599639212ca6223f94a88dbff6641ed54234f (patch)
treeae2e6952d9f9515b78ed7d638c24dc0fe04cb53a /src/Propellor/Property/HostingProvider
parent5423d7a5e25907d126944921fff0fba2451cf11b (diff)
re-organise Exoscale.distroKernel
Diffstat (limited to 'src/Propellor/Property/HostingProvider')
-rw-r--r--src/Propellor/Property/HostingProvider/Exoscale.hs20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/Propellor/Property/HostingProvider/Exoscale.hs b/src/Propellor/Property/HostingProvider/Exoscale.hs
index a123c54a..6bf19cbc 100644
--- a/src/Propellor/Property/HostingProvider/Exoscale.hs
+++ b/src/Propellor/Property/HostingProvider/Exoscale.hs
@@ -5,6 +5,7 @@ module Propellor.Property.HostingProvider.Exoscale (
) 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
@@ -15,12 +16,13 @@ import qualified Propellor.Property.Reboot as Reboot
-- We reboot after doing this because 'Sbuild.built' will fail to set up an
-- overlay-type chroot on an old kernel
distroKernel :: Architecture -> Property DebianLike
-distroKernel arch = combineProperties "boots distro kernel" $ props
- & Grub.installed' Grub.PC
- & Apt.installed ["linux-image-" ++ arch]
- -- only these ones are not idempotent so need flag file
- & flagFile
- (Grub.boots "/dev/vda"
- `before` Grub.mkConfig
- `before` Reboot.now)
- "/etc/propellor-distro-kernel"
+distroKernel arch = go `flagFile` theFlagFile
+ where
+ go = combineProperties "boots distro kernel" $ props
+ & Apt.installed ["grub2", "linux-image-" ++ arch]
+ & Grub.boots "/dev/vda"
+ & Grub.mkConfig
+ -- Since we're rebooting we have to manually create the flagfile
+ & File.hasContent theFlagFile [""]
+ & Reboot.toDistroKernel
+ theFlagFile = "/etc/propellor-distro-kernel"