propellor spin

This commit is contained in:
Joey Hess 2014-04-14 15:42:26 -04:00
parent 8bb029002e
commit e8db2577a8
Failed to extract signature
2 changed files with 10 additions and 16 deletions

View File

@ -6,8 +6,6 @@ import qualified Propellor.Property.File as File
-- | Ensures that the hostname is set to the HostAttr value. -- | Ensures that the hostname is set to the HostAttr value.
-- Configures /etc/hostname and the current hostname. -- Configures /etc/hostname and the current hostname.
-- --
-- When the hostname is a FQDN, also configures /etc/mailname
-- with the domain part.
-- A FQDN also configures /etc/hosts, with an entry for 127.0.1.1, which is -- A FQDN also configures /etc/hosts, with an entry for 127.0.1.1, which is
-- standard at least on Debian to set the FDQN (127.0.0.1 is localhost). -- standard at least on Debian to set the FDQN (127.0.0.1 is localhost).
sane :: Property sane :: Property
@ -26,9 +24,6 @@ setTo hn = combineProperties desc go
then Nothing then Nothing
else Just $ File.fileProperty desc else Just $ File.fileProperty desc
addhostline "/etc/hosts" addhostline "/etc/hosts"
, if null domain
then Nothing
else Just $ "/etc/mailname" `File.hasContent` [domain]
] ]
hostip = "127.0.1.1" hostip = "127.0.1.1"

View File

@ -2,11 +2,6 @@ module Propellor.Property.Postfix where
import Propellor import Propellor
import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Apt as Apt
import Propellor.Property.User
import Utility.SafeCommand
import Utility.FileMode
import System.PosixCompat
installed :: Property installed :: Property
installed = Apt.serviceInstalledRunning "postfix" installed = Apt.serviceInstalledRunning "postfix"
@ -18,9 +13,13 @@ installed = Apt.serviceInstalledRunning "postfix"
-- futher coniguration/keys. But this should be enough to get cron job -- futher coniguration/keys. But this should be enough to get cron job
-- mail flowing to a place where it will be seen. -- mail flowing to a place where it will be seen.
satellite :: Property satellite :: Property
satellite = Apt.reConfigure "postfix" satellite = setup `requires` installed
[ ("postfix/main_mailer_type", "select", "Satellite system") where
, ("postfix/destinations", "string", "") setup = Property "postfix satellite system" $ do
] hn <- getHostName
`describe` "postfix satellite system" ensureProperty $ Apt.reConfigure "postfix"
`requires` installed [ ("postfix/main_mailer_type", "select", "Satellite system")
, ("postfix/root_address", "string", "root")
, ("postfix/destinations", "string", " ")
, ("postfix/mailname", "string", hn)
]