propellor spin
This commit is contained in:
parent
27a00f8682
commit
39f3acd6e4
|
@ -33,6 +33,16 @@ combineProperties desc ps = Property desc $ go ps NoChange
|
|||
FailedChange -> return FailedChange
|
||||
_ -> go ls (r <> rs)
|
||||
|
||||
-- | Combines together two properties, resulting in one property
|
||||
-- that ensures the first, and if the first succeeds, ensures the second.
|
||||
-- The property uses the description of the first property.
|
||||
before :: Property -> Property -> Property
|
||||
p1 `before` p2 = Property (propertyDesc p1) $ do
|
||||
r <- ensureProperty p1
|
||||
case r of
|
||||
FailedChange -> return FailedChange
|
||||
_ -> ensureProperty p2
|
||||
|
||||
-- | Makes a perhaps non-idempotent Property be idempotent by using a flag
|
||||
-- file to indicate whether it has run before.
|
||||
-- Use with caution.
|
||||
|
|
|
@ -147,9 +147,12 @@ autoRemove = runApt ["-y", "autoremove"]
|
|||
|
||||
-- | Enables unattended upgrades. Revert to disable.
|
||||
unattendedUpgrades :: RevertableProperty
|
||||
unattendedUpgrades = RevertableProperty (go True) (go False)
|
||||
unattendedUpgrades = RevertableProperty enable disable
|
||||
where
|
||||
go enabled = (if enabled then installed else removed) ["unattended-upgrades"]
|
||||
enable = setup True `before` installed ["cron"]
|
||||
disable = setup False
|
||||
|
||||
setup enabled = (if enabled then installed else removed) ["unattended-upgrades"]
|
||||
`onChange` reConfigure "unattended-upgrades"
|
||||
[("unattended-upgrades/enable_auto_updates" , "boolean", v)]
|
||||
`describe` ("unattended upgrades " ++ v)
|
||||
|
|
|
@ -61,7 +61,7 @@ host _ = Nothing
|
|||
-- | This is where Docker containers are set up. A container
|
||||
-- can vary by hostname where it's used, or be the same everywhere.
|
||||
container :: HostName -> Docker.ContainerName -> Maybe (Docker.Container)
|
||||
container parenthost name
|
||||
container _parenthost name
|
||||
-- Simple web server, publishing the outside host's /var/www
|
||||
| name == "webserver" = Just $ Docker.containerFrom
|
||||
(image $ System (Debian Unstable) "amd64")
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
propellor (0.2.4) UNRELEASED; urgency=medium
|
||||
|
||||
* ipv6to4: Ensure interface is brought up automatically on boot.
|
||||
* Enabling unattended upgrades now ensures that cron is installed and
|
||||
running to perform them.
|
||||
|
||||
-- Joey Hess <joeyh@debian.org> Tue, 08 Apr 2014 18:07:12 -0400
|
||||
|
||||
|
|
Loading…
Reference in New Issue