summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
authorJoey Hess2014-05-23 12:30:25 -0400
committerJoey Hess2014-05-23 12:30:25 -0400
commit0ec565a590e0b5e70af4f4f922925e5b0b718376 (patch)
treebdf14818215c90e20a1d1bdb4b920d1570b15a60 /src/Propellor
parent4f239d1360c87b069279ce1b100db4a057f94e48 (diff)
propellor spin
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Property/HostingProvider/CloudAtCost.hs24
-rw-r--r--src/Propellor/Property/HostingProvider/DigitalOcean.hs21
-rw-r--r--src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs2
3 files changed, 46 insertions, 1 deletions
diff --git a/src/Propellor/Property/HostingProvider/CloudAtCost.hs b/src/Propellor/Property/HostingProvider/CloudAtCost.hs
new file mode 100644
index 00000000..003bd3c5
--- /dev/null
+++ b/src/Propellor/Property/HostingProvider/CloudAtCost.hs
@@ -0,0 +1,24 @@
+module Propellor.Property.HostingProvider.CloudAtCost where
+
+import Propellor
+import qualified Propellor.Property.Hostname as Hostname
+import qualified Propellor.Property.File as File
+import qualified Propellor.Property.Ssh as Ssh
+import qualified Propellor.Property.User as User
+
+-- Clean up a system as installed by cloudatcost.com
+decruft :: Property
+decruft = propertyList "cloudatcost cleanup"
+ [ Hostname.sane
+ , Ssh.randomHostKeys
+ , "worked around grub/lvm boot bug #743126" ==>
+ "/etc/default/grub" `File.containsLine` "GRUB_DISABLE_LINUX_UUID=true"
+ `onChange` cmdProperty "update-grub" []
+ `onChange` cmdProperty "update-initramfs" ["-u"]
+ , combineProperties "nuked cloudatcost cruft"
+ [ File.notPresent "/etc/rc.local"
+ , File.notPresent "/etc/init.d/S97-setup.sh"
+ , User.nuked "user" User.YesReallyDeleteHome
+ ]
+ ]
+
diff --git a/src/Propellor/Property/HostingProvider/DigitalOcean.hs b/src/Propellor/Property/HostingProvider/DigitalOcean.hs
new file mode 100644
index 00000000..24dfd356
--- /dev/null
+++ b/src/Propellor/Property/HostingProvider/DigitalOcean.hs
@@ -0,0 +1,21 @@
+module Propellor.Property.HostingProvider.DigitalOcean where
+
+import Propellor
+import qualified Propellor.Property.Apt as Apt
+import qualified Propellor.Property.File as File
+
+-- Digital Ocean does not provide any way to boot
+-- the kernel provided by the distribution, except using kexec.
+-- Without this, some old, and perhaps insecure kernel will be used.
+--
+-- Note that this only causes the new kernel to be loaded on reboot.
+-- If the power is cycled, the old kernel still boots up.
+-- TODO: detect this and reboot immediately?
+distroKernel :: Property
+distroKernel = propertyList "digital ocean distro kernel hack"
+ [ Apt.installed ["grub-pc", "kexec-tools"]
+ , "/etc/default/kexec" `File.containsLines`
+ [ "LOAD_KEXEC=true"
+ , "USE_GRUB_CONFIG=true"
+ ]
+ ]
diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
index 56123b60..8055a608 100644
--- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
+++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
@@ -140,4 +140,4 @@ armelContainer dockerImage crontimes timeout = Docker.container "armel-git-annex
where
writecompanionaddress = scriptProperty
[ "echo \"$COMPANION_PORT_22_TCP_ADDR\" > " ++ homedir </> "companion_address"
- ]
+ ] `describe` "companion_address file"