From 5c55d3d4153e571876383e53dc43e38ce767e34d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 13 Jun 2016 18:12:29 -0400 Subject: improve some comments --- src/Propellor/Property/HostingProvider/DigitalOcean.hs | 2 +- src/Propellor/Property/HostingProvider/Exoscale.hs | 2 ++ src/Propellor/Property/Reboot.hs | 14 ++++++++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src/Propellor/Property') diff --git a/src/Propellor/Property/HostingProvider/DigitalOcean.hs b/src/Propellor/Property/HostingProvider/DigitalOcean.hs index 084faa36..053338de 100644 --- a/src/Propellor/Property/HostingProvider/DigitalOcean.hs +++ b/src/Propellor/Property/HostingProvider/DigitalOcean.hs @@ -13,7 +13,7 @@ import qualified Propellor.Property.Reboot as Reboot -- -- This property causes the distro kernel to be loaded on reboot, using kexec. -- --- If the power is cycled, the non-distro kernel still boots up. +-- When the power is cycled, the non-distro kernel still boots up. -- So, this property also checks if the running kernel is present in /boot, -- and if not, reboots immediately into a distro kernel. distroKernel :: Property DebianLike diff --git a/src/Propellor/Property/HostingProvider/Exoscale.hs b/src/Propellor/Property/HostingProvider/Exoscale.hs index c6244d46..3e6f6665 100644 --- a/src/Propellor/Property/HostingProvider/Exoscale.hs +++ b/src/Propellor/Property/HostingProvider/Exoscale.hs @@ -1,4 +1,6 @@ -- | Maintainer: Sean Whitton +-- +-- Properties for use on module Propellor.Property.HostingProvider.Exoscale ( distroKernel, diff --git a/src/Propellor/Property/Reboot.hs b/src/Propellor/Property/Reboot.hs index 7733c0d2..5bb426d5 100644 --- a/src/Propellor/Property/Reboot.hs +++ b/src/Propellor/Property/Reboot.hs @@ -13,11 +13,20 @@ import Text.ParserCombinators.ReadP type KernelVersion = String +-- | Using this property causes an immediate reboot. +-- +-- So, this is not a useful property on its own, but it can be useful to +-- compose with other properties. For example: +-- +-- > Apt.installed ["new-kernel"] +-- > `onChange` Reboot.now now :: Property Linux now = tightenTargets $ cmdProperty "reboot" [] `assume` MadeChange `describe` "reboot now" +type Force = Bool + -- | Schedules a reboot at the end of the current propellor run. -- -- The `Result` code of the entire propellor run can be checked; @@ -25,7 +34,7 @@ now = tightenTargets $ cmdProperty "reboot" [] -- -- The reboot can be forced to run, which bypasses the init system. Useful -- if the init system might not be running for some reason. -atEnd :: Bool -> (Result -> Bool) -> Property Linux +atEnd :: Force -> (Result -> Bool) -> Property Linux atEnd force resultok = property "scheduled reboot at end of propellor run" $ do endAction "rebooting" atend return NoChange @@ -44,7 +53,8 @@ atEnd force resultok = property "scheduled reboot at end of propellor run" $ do -- running. -- -- This will only work if you have taken measures to ensure that the other --- kernel won't just get booted again. See 'Propellor.Property.DigitalOcean' +-- kernel won't just get booted again. +-- See 'Propellor.Property.HostingProvider.DigitalOcean' -- for an example of how to do this. toDistroKernel :: Property DebianLike toDistroKernel = check (not <$> runningInstalledKernel) now -- cgit v1.2.3