propellor spin
This commit is contained in:
parent
caeed5492f
commit
c186f9f4a8
|
@ -24,6 +24,7 @@ import qualified Propellor.Property.Postfix as Postfix
|
||||||
import qualified Propellor.Property.Grub as Grub
|
import qualified Propellor.Property.Grub as Grub
|
||||||
import qualified Propellor.Property.Obnam as Obnam
|
import qualified Propellor.Property.Obnam as Obnam
|
||||||
import qualified Propellor.Property.Gpg as Gpg
|
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.DigitalOcean as DigitalOcean
|
||||||
import qualified Propellor.Property.HostingProvider.CloudAtCost as CloudAtCost
|
import qualified Propellor.Property.HostingProvider.CloudAtCost as CloudAtCost
|
||||||
import qualified Propellor.Property.HostingProvider.Linode as Linode
|
import qualified Propellor.Property.HostingProvider.Linode as Linode
|
||||||
|
@ -80,6 +81,8 @@ clam = standardSystem "clam.kitenet.net" Unstable "amd64"
|
||||||
! Ssh.listenPort 80
|
! Ssh.listenPort 80
|
||||||
! Ssh.listenPort 443
|
! Ssh.listenPort 443
|
||||||
|
|
||||||
|
& Debootstrap.built "/tmp/chroot" (System (Debian Unstable) "amd64") []
|
||||||
|
|
||||||
orca :: Host
|
orca :: Host
|
||||||
orca = standardSystem "orca.kitenet.net" Unstable "amd64"
|
orca = standardSystem "orca.kitenet.net" Unstable "amd64"
|
||||||
[ "Main git-annex build box." ]
|
[ "Main git-annex build box." ]
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
module Propellor.Property.Debootstrap (
|
module Propellor.Property.Debootstrap (
|
||||||
Url,
|
Url,
|
||||||
debootstrapped,
|
built,
|
||||||
installed,
|
installed,
|
||||||
debootstrapPath,
|
programPath,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Propellor
|
import Propellor
|
||||||
|
@ -28,8 +28,8 @@ type Url = String
|
||||||
--
|
--
|
||||||
-- Note that reverting this property does not stop any processes
|
-- Note that reverting this property does not stop any processes
|
||||||
-- currently running in the chroot.
|
-- currently running in the chroot.
|
||||||
debootstrapped :: FilePath -> System -> [CommandParam] -> RevertableProperty
|
built :: FilePath -> System -> [CommandParam] -> RevertableProperty
|
||||||
debootstrapped target system@(System _ arch) extraparams =
|
built target system@(System _ arch) extraparams =
|
||||||
RevertableProperty setup teardown
|
RevertableProperty setup teardown
|
||||||
where
|
where
|
||||||
setup = check (unpopulated target) setupprop
|
setup = check (unpopulated target) setupprop
|
||||||
|
@ -49,7 +49,7 @@ debootstrapped target system@(System _ arch) extraparams =
|
||||||
, Param target
|
, Param target
|
||||||
, Param $ "--arch=" ++ arch
|
, Param $ "--arch=" ++ arch
|
||||||
]
|
]
|
||||||
cmd <- fromMaybe "debootstrap" <$> debootstrapPath
|
cmd <- fromMaybe "debootstrap" <$> programPath
|
||||||
ifM (boolSystem cmd params)
|
ifM (boolSystem cmd params)
|
||||||
( do
|
( do
|
||||||
fixForeignDev target
|
fixForeignDev target
|
||||||
|
@ -83,7 +83,7 @@ installed :: RevertableProperty
|
||||||
installed = RevertableProperty install remove
|
installed = RevertableProperty install remove
|
||||||
where
|
where
|
||||||
install = withOS "debootstrap installed" $ \o ->
|
install = withOS "debootstrap installed" $ \o ->
|
||||||
ifM (liftIO $ isJust <$> debootstrapPath)
|
ifM (liftIO $ isJust <$> programPath)
|
||||||
( return NoChange
|
( return NoChange
|
||||||
, ensureProperty (installon o)
|
, ensureProperty (installon o)
|
||||||
)
|
)
|
||||||
|
@ -157,8 +157,8 @@ wrapperScript = sourceInstallDir </> "debootstrap.wrapper"
|
||||||
-- | Finds debootstrap in PATH, but fall back to looking for the
|
-- | Finds debootstrap in PATH, but fall back to looking for the
|
||||||
-- wrapper script that is installed, outside the PATH, when debootstrap
|
-- wrapper script that is installed, outside the PATH, when debootstrap
|
||||||
-- is installed from source.
|
-- is installed from source.
|
||||||
debootstrapPath :: IO (Maybe FilePath)
|
programPath :: IO (Maybe FilePath)
|
||||||
debootstrapPath = getM searchPath
|
programPath = getM searchPath
|
||||||
[ "debootstrap"
|
[ "debootstrap"
|
||||||
, wrapperScript
|
, wrapperScript
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue