Forge Home

timezone

A module to manage timezone settings

13,442 downloads

6,833 latest version

5.0 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.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

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
  • , , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'kogitoapp-timezone', '2.1.1'
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 2.1.1

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 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.