Version information
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
Add this module to your Puppetfile:
mod 'kogitoapp-timezone', '1.1.5'
Learn more about managing modules with a PuppetfileDocumentation
puppet-timezone
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.
(2017-03-23) Release 1.1.5
Bug fixes
- Removed unsupported "pe" version requirement.
(2017-03-23) Release 1.1.4
Bug fixes
- Fixed deprecation warning about
data_provider
.
(2017-02-15) Release 1.1.3
Bug fixes
- Fixed Rubocop offenses. Sorry, we offended you!
- use
YAML.safe_load
instead ofYAML.load
- use
Security/Eval
instead ofLint/Eval
check
- use
- Fixed specs to avoid nested groups.
- Added note about using
rubocop
to README.
(2017-02-15) Release 1.1.2
Bug fixes
- Fixed Rubocop configuration
- Fixed wrong version in module metadata
(2017-02-15) Release 1.1.1
Maintenance
- Updated dependecy to puppet-yum 1.0.0
(2016-12-28) Release 1.1.0
New features
- Integrate stm-debconf for Debian operating system family. This fixes #1.
- Use file or link resources for
localtime
as expected on targetosfamily
. This fixes #2.
(2016-12-28) Release 1.0.5
Maintenance
- Removed DEBUG mode for Beaker builds.
- Removed Ruby 2.4.0 build from Travis.
- Added required Puppet Open Source and Puppet Enterprise versions. Rule of thumb: if it supports Puppet 4.0 language features, it has to run.
2016-12-27 Release 1.0.4
Bug fixes
- Enable code coverage reports to Coveralls.
2016-12-27 Release 1.0.3
Bug fixes
- Ignore
vendor
directory to reduce size of releases submitted to Puppet Forge.
2016-12-27 Release 1.0.2
Bug fixes
- Correct Puppet Forge metadata
2016-12-27 Release 1.0.1
Maintenance
- Test release for TravisCI builds.
2016-12-26 Release 1.0.0
Initial release of timezone management module! Hurra!
New features
- support package and configuration of timezone on Debian, Ubuntu, CentOS, RHEL, and Fedora
Bug fixes
- ... nothing yet!
Maintenance
- ... adding in Travis CI build settings and Puppet Forge deployment.
Dependencies
- puppetlabs-stdlib (>= 4.14.0 < 5.0.0)
- puppet-yum (>= 1.0.0 < 2.0.0)
- puppetlabs-apt (>= 2.3.0 < 3.0.0)
- stm-debconf (>= 1.0.0 < 2.0.0)
Copyright 2016 Daniel S. Reichenbach <https://kogitoapp.com/> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.