Managing timezones

"I try to take one day at a time, but sometimes several days attack at once."— Ashleigh Brilliant

Sooner or later, you'll encounter a weird problem, which you'll eventually track down to servers having different time zones. It's wise to avoid this kind of issue by making sure that all your servers use the same time zone, whatever their geographical location (GMT is the logical choice).

Unless a server is solar powered, I can't think of any reason for it to care about the time zone it's in.

How to do it…

  1. Create the file /etc/puppet/modules/admin/manifests/gmt.pp with the following contents:
    class admin::gmt
    {
        file { "/etc/localtime":
            ensure => link,
            target => "/usr/share/zoneinfo/GMT",
             }
    }
  2. Add the following to all nodes:
    include admin::gmt ...

Get Puppet 2.7 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.