summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Timezone.hs
blob: 91dcbfc65ee7ef0851a214e66cd6850012adad57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- | Maintainer: Sean Whitton <spwhitton@spwhitton.name>

module Propellor.Property.Timezone where

import Propellor.Base
import qualified Propellor.Property.Apt as Apt

type Timezone = String

-- | Sets the system's timezone
configured :: Timezone -> Property DebianLike
configured zone = File.hasContent "/etc/timezone" zone
	`onChange` update
	`describe` (zone ++ " timezone configured")
  where
	update = Apt.reConfigure "tzdata" mempty
		-- work around a bug in recent tzdata.  See
		-- https://bugs.launchpad.net/ubuntu/+source/tzdata/+bug/1554806/
		`requires` File.notPresent "/etc/localtime"