summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2014-11-19 20:41:35 -0400
committerJoey Hess2014-11-19 20:41:35 -0400
commitc186f9f4a858edfe0f2211e71da07715bd2e99b7 (patch)
tree87ce4360b28a3f19fd758b9d2243f8be984fc8b9
parentcaeed5492fa3c66668d750a79ea5886248c6bd07 (diff)
propellor spin
-rw-r--r--config-joey.hs3
-rw-r--r--src/Propellor/Property/Debootstrap.hs16
2 files changed, 11 insertions, 8 deletions
diff --git a/config-joey.hs b/config-joey.hs
index 98dac3e7..fad37b08 100644
--- a/config-joey.hs
+++ b/config-joey.hs
@@ -24,6 +24,7 @@ import qualified Propellor.Property.Postfix as Postfix
import qualified Propellor.Property.Grub as Grub
import qualified Propellor.Property.Obnam as Obnam
import qualified Propellor.Property.Gpg as Gpg
+import qualified Propellor.Property.Debootstrap as Debootstrap
import qualified Propellor.Property.HostingProvider.DigitalOcean as DigitalOcean
import qualified Propellor.Property.HostingProvider.CloudAtCost as CloudAtCost
import qualified Propellor.Property.HostingProvider.Linode as Linode
@@ -79,6 +80,8 @@ clam = standardSystem "clam.kitenet.net" Unstable "amd64"
& alias "travelling.kitenet.net"
! Ssh.listenPort 80
! Ssh.listenPort 443
+
+ & Debootstrap.built "/tmp/chroot" (System (Debian Unstable) "amd64") []
orca :: Host
orca = standardSystem "orca.kitenet.net" Unstable "amd64"
diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs
index 876c12cb..70a0dd9c 100644
--- a/src/Propellor/Property/Debootstrap.hs
+++ b/src/Propellor/Property/Debootstrap.hs
@@ -1,8 +1,8 @@
module Propellor.Property.Debootstrap (
Url,
- debootstrapped,
+ built,
installed,
- debootstrapPath,
+ programPath,
) where
import Propellor
@@ -28,8 +28,8 @@ type Url = String
--
-- Note that reverting this property does not stop any processes
-- currently running in the chroot.
-debootstrapped :: FilePath -> System -> [CommandParam] -> RevertableProperty
-debootstrapped target system@(System _ arch) extraparams =
+built :: FilePath -> System -> [CommandParam] -> RevertableProperty
+built target system@(System _ arch) extraparams =
RevertableProperty setup teardown
where
setup = check (unpopulated target) setupprop
@@ -49,7 +49,7 @@ debootstrapped target system@(System _ arch) extraparams =
, Param target
, Param $ "--arch=" ++ arch
]
- cmd <- fromMaybe "debootstrap" <$> debootstrapPath
+ cmd <- fromMaybe "debootstrap" <$> programPath
ifM (boolSystem cmd params)
( do
fixForeignDev target
@@ -83,7 +83,7 @@ installed :: RevertableProperty
installed = RevertableProperty install remove
where
install = withOS "debootstrap installed" $ \o ->
- ifM (liftIO $ isJust <$> debootstrapPath)
+ ifM (liftIO $ isJust <$> programPath)
( return NoChange
, ensureProperty (installon o)
)
@@ -157,8 +157,8 @@ wrapperScript = sourceInstallDir </> "debootstrap.wrapper"
-- | Finds debootstrap in PATH, but fall back to looking for the
-- wrapper script that is installed, outside the PATH, when debootstrap
-- is installed from source.
-debootstrapPath :: IO (Maybe FilePath)
-debootstrapPath = getM searchPath
+programPath :: IO (Maybe FilePath)
+programPath = getM searchPath
[ "debootstrap"
, wrapperScript
]