Puppet Class: timezone

Defined in:
manifests/init.pp

Summary

This module manages the system's default timezone setting.

Overview

Examples:

Declaring the class

include timezone

Parameters:

  • timezone (String[1]) (defaults to: 'UTC')

    The systems default timezone, e.g. ‘UTC’ or ‘Europe/Berlin’. See /usr/share/zoneinfo for available values.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'manifests/init.pp', line 10

class timezone (
  String[1] $timezone = 'UTC',
) {

  $tzdata = "/usr/share/zoneinfo/${timezone}"

  file { '/etc/localtime':
    ensure => link,
    target => $tzdata,
  }

  if $facts['os']['family'] == 'Debian' {
    file { '/etc/timezone':
      owner   => 'root',
      group   => 'root',
      mode    => '0644',
      content => "${timezone}\n",
    }
  }
}