diff options
| author | Sean Whitton <spwhitton@spwhitton.name> | 2017-07-15 17:02:48 -0700 |
|---|---|---|
| committer | Sean Whitton <spwhitton@spwhitton.name> | 2017-07-15 17:02:48 -0700 |
| commit | 6f2ea4ecc79dc191ec690d57d0cabb19542ddd65 (patch) | |
| tree | 113dee45089a24e1b67adab5868392c640387f58 /src | |
| parent | 8ffd10be9715643cb7474a3d96b69a828537aa4a (diff) | |
add Timezone.configured
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Timezone.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Propellor/Property/Timezone.hs b/src/Propellor/Property/Timezone.hs new file mode 100644 index 00000000..91dcbfc6 --- /dev/null +++ b/src/Propellor/Property/Timezone.hs @@ -0,0 +1,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" |
