timezone

A module to manage timezone settings

Kogito UG

kogitoapp

10,426 downloads

5,206 latest version

5.0 quality score

Version information

  • 2.1.1 (latest)
  • 2.1.0
  • 2.0.5
  • 2.0.4
  • 2.0.3
  • 2.0.2
  • 2.0.1
  • 2.0.0
  • 1.2.0
  • 1.1.5
  • 1.1.4
  • 1.1.3
  • 1.1.2
  • 1.1.0
  • 1.0.5
  • 1.0.4
  • 1.0.3
  • 1.0.1
released Nov 15th 2017
This version is compatible with:
  • Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
  • Puppet >= 4.10.8 < 6.0.0
  • CentOS
    ,
    OracleLinux
    ,
    RedHat
    ,
    Scientific
    ,
    Debian
    ,
    Ubuntu

Start using this module

Documentation

kogitoapp/timezone — version 2.1.1 Nov 15th 2017

puppet-timezone

Build Status Puppet Forge Puppet Forge - downloads Puppet Forge - scores

Description

A Puppet module for managing timezone settings. This module allows you to install and configure timezone settings using operating system specific facilities with just a single parameter.

Setup

What timezone affects

  • Locale timezone configuration file. For all supported systems this is /etc/localtime.
  • The timezone configuration file. Depending on the operating system this can be:
    • /etc/timezone for the Debian/Ubuntu operating system family,
    • /etc/sysconfig/clock for CentOS/RedHat operating system family below version 7,
  • For Debian/Ubuntu, CentOS/RedHat operating system families it will install the tzdata package.
  • puppet-timezone depends on

Beginning with timezone

The simplest use case is to rely on the Coordinated Universal Timezone. This can be done by simply including the class:

include ::timezone

Most of the time though you will be provisioning in specific regions of the world and thus may want to pass a timezone:

class { '::timezone':
    timezone => 'Europe/Berlin',
}

A list of valid timezone strings is available on Wikipedia.

Usage

In addition to configuring the timezone you can also modify and customize related settings such as if the hardware clock is set to UTC, or inject your own zone information or even package.

class { '::timezone':
    timezone => 'Europe/Berlin',
    package_ensure => 'present',
    manage_package => true,
}

Reference

Class: timezone

class { 'timezone':
    timezone                => 'Etc/UTC',
    hw_utc                  => true,

    package_ensure          => 'present',
    package_name            => 'tzdata',
    package_provider        => 'apt',
    package_install_options => [],
    manage_package          => true,

    zoneinfo_dir           => '/usr/share/zoneinfo',
    localtime_file         => '/etc/localtime',
    localtime_file_type    => 'file',
    timezone_file          => '/etc/timezone',
    timezone_file_template => 'timezone/debian-timezone.erb',
    timezone_file_comments => false,
    timezone_update        => false,
}

Class: timezone::install

class { 'timezone::install':
    package_ensure          => 'present',
    package_name            => 'tzdata',
    package_provider        => 'apt',
    package_install_options => [],
    manage_package          => true,
    timezone                => 'Etc/UTC',
}

Class: timezone::config

class { 'timezone::config':
    timezone               => 'Europe/Berlin',
    hw_utc                 => true,
    package_ensure         => 'present',
    zoneinfo_dir           => '/usr/share/zoneinfo',
    localtime_file         => '/etc/localtime',
    localtime_file_type    => 'file',
    timezone_file          => '/etc/timezone',
    timezone_file_template => 'timezone/debian-timezone.erb',
    timezone_file_comments => false,
    timezone_update        => false,
}

Limitations

See metadata.json for supported platforms

Development

Running tests

This project contains tests for rspec-puppet.

Quickstart:

gem install bundler
bundle install
bundle exec rake test

When submitting pull requests, please make sure that module documentation, test cases and syntax checks pass.