propellor spin

This commit is contained in:
Joey Hess 2014-07-07 03:16:18 -04:00
parent dba84b8219
commit 461b8cbd32
Failed to extract signature
3 changed files with 13 additions and 6 deletions

View File

@ -78,8 +78,13 @@ hosts = -- (o) `
& ipv4 "66.228.36.95" & ipv4 "66.228.36.95"
& ipv6 "2600:3c03::f03c:91ff:fe73:b0d2" & ipv6 "2600:3c03::f03c:91ff:fe73:b0d2"
& File.hasContent "/etc/motd"
[ "Welcome to the new kitenet.net server!"
, "This is still under construction and not yet live.."
]
& Apt.installed ["linux-image-amd64"] & Apt.installed ["linux-image-amd64"]
& Linode.chainPVGrub & Linode.chainPVGrub 5
& Hostname.sane & Hostname.sane
& Apt.unattendedUpgrades & Apt.unattendedUpgrades
& Apt.installed ["systemd"] & Apt.installed ["systemd"]
@ -151,7 +156,7 @@ hosts = -- (o) `
in standardSystem "elephant.kitenet.net" Unstable "amd64" in standardSystem "elephant.kitenet.net" Unstable "amd64"
& ipv4 "193.234.225.114" & ipv4 "193.234.225.114"
& Grub.chainPVGrub "hd0,0" "xen/xvda1" & Grub.chainPVGrub "hd0,0" "xen/xvda1" 30
& Hostname.sane & Hostname.sane
& Postfix.satellite & Postfix.satellite
& Apt.unattendedUpgrades & Apt.unattendedUpgrades

View File

@ -7,6 +7,8 @@ import qualified Propellor.Property.Apt as Apt
-- | Eg, hd0,0 or xen/xvda1 -- | Eg, hd0,0 or xen/xvda1
type GrubDevice = String type GrubDevice = String
type TimeoutSecs = Int
-- | Use PV-grub chaining to boot -- | Use PV-grub chaining to boot
-- --
-- Useful when the VPS's pv-grub is too old to boot a modern kernel image. -- Useful when the VPS's pv-grub is too old to boot a modern kernel image.
@ -15,12 +17,12 @@ type GrubDevice = String
-- --
-- The rootdev should be in the form "hd0", while the bootdev is in the form -- The rootdev should be in the form "hd0", while the bootdev is in the form
-- "xen/xvda". -- "xen/xvda".
chainPVGrub :: GrubDevice -> GrubDevice -> Property chainPVGrub :: GrubDevice -> GrubDevice -> TimeoutSecs -> Property
chainPVGrub rootdev bootdev = combineProperties desc chainPVGrub rootdev bootdev timeout = combineProperties desc
[ File.dirExists "/boot/grub" [ File.dirExists "/boot/grub"
, "/boot/grub/menu.lst" `File.hasContent` , "/boot/grub/menu.lst" `File.hasContent`
[ "default 1" [ "default 1"
, "timeout 30" , "timeout " ++ show timeout
, "" , ""
, "title grub-xen shim" , "title grub-xen shim"
, "root (" ++ rootdev ++ ")" , "root (" ++ rootdev ++ ")"

View File

@ -6,5 +6,5 @@ import qualified Propellor.Property.Grub as Grub
-- | Linode's pv-grub-x86_64 does not currently support booting recent -- | Linode's pv-grub-x86_64 does not currently support booting recent
-- Debian kernels compressed with xz. This sets up pv-grub chaing to enable -- Debian kernels compressed with xz. This sets up pv-grub chaing to enable
-- it. -- it.
chainPVGrub :: Property chainPVGrub :: Grub.TimeoutSecs -> Property
chainPVGrub = Grub.chainPVGrub "hd0" "xen/xvda" chainPVGrub = Grub.chainPVGrub "hd0" "xen/xvda"