Setting timezone in ubuntu and timezone conventions

1,145 views
Skip to first unread message

kevin

unread,
Mar 14, 2009, 12:15:27 PM3/14/09
to Puppet Users
Is there a puppet way to set timezones in ubuntu? I've been using
dpkg-reconfigure, but that shows me a gui, which is somewhat
distasteful

Slightly off topic:

What is the convention for setting timezones? Set them based on the
servers phsyical location? On the admin's location? Clients
location? Ideas?

Jonathan Moore

unread,
Mar 14, 2009, 12:45:06 PM3/14/09
to puppet...@googlegroups.com
On 3/14/09, kevin <laz...@gmail.com> wrote:
> What is the convention for setting timezones? Set them based on the
> servers phsyical location? On the admin's location? Clients
> location? Ideas?

I set my system clocks to UTC, then configure the local clock to
whatever the local timezone.

If I'm doing anything like centralized logging, it's nice have
everything in UTC and the convert the time stamps to local if needed /
wanted.

I'd also like to hear what others do here.

-jon

Jason Rojas

unread,
Mar 14, 2009, 3:07:29 PM3/14/09
to puppet...@googlegroups.com, Puppet Users
Afaik, most timezones are set up as a symlink /etc/localtime -> /
whatever/path/zoneinfo
This should be fairly easy to manage as long as all the machines are
in the same timezone.

Symbolic links are managed by the file type, so it's Fairly simple:

File {

"/etc/localtime":
ensure => "/path/to/correct_zone";
}

At least that's how it is in redhat distros.


-Jason

John Ferlito

unread,
Mar 14, 2009, 7:04:05 PM3/14/09
to puppet...@googlegroups.com
On Sat, Mar 14, 2009 at 09:15:27AM -0700, kevin wrote:
>
> Is there a puppet way to set timezones in ubuntu? I've been using
> dpkg-reconfigure, but that shows me a gui, which is somewhat
> distasteful

For ubuntu I do the following, which is pretty much what the GUI tool
does.(I think most other distros would be exactly the same)

file {
"/etc/localtime":
ensure => "/usr/share/zoneinfo/Australia/Sydney"
}

file {
"/etc/timezone":
content => "Australia/Sydney\n",
}

file {
"/etc/default/locale":
content => "LANG=\"en_AU.UTF-8\"\nLANGUAGE=\"en_AU:en\"\n"
}

> Slightly off topic:
>
> What is the convention for setting timezones? Set them based on the
> servers phsyical location? On the admin's location? Clients
> location? Ideas?

So IMHO the critial thing is that all your servers are on the same
timezone no matter where they are in the world. This simply makes it
easier when trying to compare logs on different servers when they are
interacting with each other.

As far as picking which time zone it depends on where all your team
is. For myself all our admins are in Sydney/Australia so we set
everything to that timezone. If you are larger and have admins in
multiple timezones then UTC is probably best.

Cheers,

--
John
Blog http://www.inodes.org/blog
OLPC Friends http://olpcfriends.org

kevin

unread,
Mar 15, 2009, 6:03:28 PM3/15/09
to Puppet Users
Thanks to all who replied. UTC sounds good to me.
Reply all
Reply to author
Forward
0 new messages