summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2017-07-16 12:07:06 -0400
committerJoey Hess2017-07-16 12:07:06 -0400
commita9c4753bf46a980117425ca8e85ba899f976514a (patch)
tree88410fd7412ea441449593db2b74482fc29d375b
parent6239110550a5ecfd14c905b910fc96deb83ce339 (diff)
parent2d1b302bb29332f6afa602bb4b4a5cca75bf99fd (diff)
Merge remote-tracking branch 'spwhitton/timezone'
-rw-r--r--src/Propellor/Property/Timezone.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Propellor/Property/Timezone.hs b/src/Propellor/Property/Timezone.hs
new file mode 100644
index 00000000..96a5e59c
--- /dev/null
+++ b/src/Propellor/Property/Timezone.hs
@@ -0,0 +1,21 @@
+-- | Maintainer: Sean Whitton <spwhitton@spwhitton.name>
+
+module Propellor.Property.Timezone where
+
+import Propellor.Base
+import qualified Propellor.Property.Apt as Apt
+import qualified Propellor.Property.File as File
+
+-- | A timezone from /usr/share/zoneinfo
+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"