Skip to content

A module to manage Windows Time configuration using NTP

Notifications You must be signed in to change notification settings

ncorrare/windowstime

Repository files navigation

windowstime

Table of Contents

  1. Description
  2. Setup - The basics of getting started with windowstime
  3. Development - Guide for contributing to the module

Description

This module configures NTP sync on Windows Servers. It's extremely useful on standalone instances not connected to AD, but can also be modified to sync from the AD domain where required by changing the syncflag setting from 'local' to 'domain'. It switches the W32time Service from triggered to running, so it's constantly verifying and syncing the clock. It can also configure the systems in the correct timezone.

Setup

What windowstime affects

  • Alters the HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\NtpServer to the defined list (and flags) of NTP servers.
  • Alters HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\Type to NTP or NT5DS depending on syncflag setting (default: NTP)
  • Configures the w32time service.
  • Does an initial resync.
  • If timezone is set, it will configure the system to the specified timezone.

Node Graph

Beginning with windowstime

You can just include the class to configure the server to sane defaults:

  include ::windowstime

Or configure your own NTP servers:

    class { 'windowstime':
      servers => { 'pool.ntp.org'     => '0x01',
                   'time.windows.com' => '0x01',
                 }
    }

Or configure your NTP servers and the syncflag:

   class { 'windowstime':
     servers => { 'pool.ntp.org' => '0x01',
                  'time.windows.com' => '0x02',
                },
     syncflag => 'local',
   }

Or configure your NTP servers and the timezone:

    class { 'windowstime':
      servers  => { 'pool.ntp.org'     => '0x01',
                    'time.windows.com' => '0x01',
                  },
      timezone => 'Greenwich Standard Time',
    }

Timezone values are validated to parameters accepted from the tzutil command. You can check the full list on data/common.yaml.

Please ensure that servers have the correct flag:

  • 0x01 SpecialInterval
  • 0x02 UseAsFallbackOnly
  • 0x04 SymmatricActive
  • 0x08 Client

Development

Regular rules apply, send a PR and I promise to look at it as soon as I can.

About

A module to manage Windows Time configuration using NTP

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •