From 8bb029002e547f272e705d92dbc9c4fa53a63d78 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 14 Apr 2014 15:35:29 -0400 Subject: propellor spin --- Propellor/Property/Postfix.hs | 26 ++++++++++++++++++++++++++ config-joey.hs | 7 +++++-- propellor.cabal | 1 + 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 Propellor/Property/Postfix.hs diff --git a/Propellor/Property/Postfix.hs b/Propellor/Property/Postfix.hs new file mode 100644 index 00000000..c253aac2 --- /dev/null +++ b/Propellor/Property/Postfix.hs @@ -0,0 +1,26 @@ +module Propellor.Property.Postfix where + +import Propellor +import qualified Propellor.Property.Apt as Apt +import Propellor.Property.User +import Utility.SafeCommand +import Utility.FileMode + +import System.PosixCompat + +installed :: Property +installed = Apt.serviceInstalledRunning "postfix" + +-- | Configures postfix as a satellite system, which +-- relats all mail through a relay host, which defaults to smtp.domain. +-- +-- The smarthost may refuse to relay mail on to other domains, without +-- futher coniguration/keys. But this should be enough to get cron job +-- mail flowing to a place where it will be seen. +satellite :: Property +satellite = Apt.reConfigure "postfix" + [ ("postfix/main_mailer_type", "select", "Satellite system") + , ("postfix/destinations", "string", "") + ] + `describe` "postfix satellite system" + `requires` installed diff --git a/config-joey.hs b/config-joey.hs index 00c811d2..6039a529 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -18,6 +18,7 @@ import qualified Propellor.Property.OpenId as OpenId import qualified Propellor.Property.Docker as Docker import qualified Propellor.Property.Git as Git import qualified Propellor.Property.Apache as Apache +import qualified Propellor.Property.Postfix as Postfix import qualified Propellor.Property.SiteSpecific.GitHome as GitHome import qualified Propellor.Property.SiteSpecific.GitAnnexBuilder as GitAnnexBuilder import qualified Propellor.Property.SiteSpecific.JoeySites as JoeySites @@ -40,7 +41,9 @@ hosts = -- (o) ` & Apt.unattendedUpgrades & Network.ipv6to4 & Tor.isBridge + & Postfix.satellite & Docker.configured + & cname "shell.olduse.net" & JoeySites.oldUseNetShellBox @@ -62,6 +65,7 @@ hosts = -- (o) ` , standardSystem "orca.kitenet.net" Unstable "amd64" & Hostname.sane & Apt.unattendedUpgrades + & Postfix.satellite & Docker.configured & Docker.docked hosts "amd64-git-annex-builder" & Docker.docked hosts "i386-git-annex-builder" @@ -79,8 +83,7 @@ hosts = -- (o) ` & Apt.unattendedUpgrades & Apt.serviceInstalledRunning "ntp" & Dns.zones myDnsSecondary - - & Apt.serviceInstalledRunning "postfix" + & Postfix.satellite & Apt.serviceInstalledRunning "apache2" & File.hasPrivContent "/etc/ssl/certs/web.pem" diff --git a/propellor.cabal b/propellor.cabal index 1d625381..482f2de6 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -81,6 +81,7 @@ Library Propellor.Property.Network Propellor.Property.Obnam Propellor.Property.OpenId + Propellor.Property.Postfix Propellor.Property.Reboot Propellor.Property.Scheduled Propellor.Property.Service -- cgit v1.2.3