Forge Home

timezone

Manage timezone settings with Puppet

13,201 downloads

6,737 latest version

4.3 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

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 Mar 23rd 2017
This version is compatible with:
  • Puppet Enterprise 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.0.0 < 5.0.0
  • , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'kogitoapp-timezone', '1.1.5'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add kogitoapp-timezone
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install kogitoapp-timezone --version 1.1.5

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download
Tags: timezone, linux

Documentation

kogitoapp/timezone — version 1.1.5 Mar 23rd 2017

puppet-timezone

Build Status Code Coverage 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::params

class { 'timezone::params':
    timezone                => 'Etc/UTC',
    hw_utc                  => true,
    package_ensure          => 'latest',
    package_install_options => [],
    manage_package          => true,
}

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 lint
$ bundle exec rake validate
$ bundle exec rake rubocop
$ bundle exec rake test

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