cookbook 'win_time', '~> 1.2.0'
win_time (2) Versions 1.2.0 Follow1
Provides resources for configuring system time in Windows
cookbook 'win_time', '~> 1.2.0', :supermarket
knife supermarket install win_time
knife supermarket download win_time
Windows Time Cookbook
Maintainer: OIT Systems Engineering (ua-oit-se@alaska.edu)
Purpose
The custom resources in this cookbook implement the mechanism for configuring both the time zone and time servers in Windows. For an example of a policy for how to configure time, see the se-win-baseline cookbook.
Requirements
Chef
This cookbook requires Chef 14+
Platforms
Supported Platform Families:
- Windows
Platforms validated via Test Kitchen:
- Windows Server 2016
- Windows Server 2012
- Windows Server 2008R2
- Windows 10
Notes:
- This is a low-level cookbook with precondition that Powershell 5.0 is installed
- Custom resources will not work with previous versions of Powershell
- Windows 2008 and 2012 require WMF update to install Powershell 5.0
- Powershell is not installed by this cookbook
Dependencies
This cookbook does not constrain its dependencies because it is intended as a utility library. It should ultimately be used within a wrapper cookbook.
Resources
This cookbook provides two resources for managing system time in Windows. See Set-TimeZone for details on configuring time zone in Windows.
time_client
A time_client provides a single action to configure the time server for NTP/Win32tm.
Actions
One action is provided.
-
set_server_name
- Post condition is that the named server is used for time queries.
Attributes
This resource has a two attributes.
-
name
- Thename_property
of the resource. Must be unique but otherwise ignored. -
server_url
- The URL of a time server, e.g.ntp.alaska.edu
.
time_zone
A time_zone provides a single action to set the time zone for the system clock.
Actions
One action is provided.
-
set_zone
- Post condition is that the named time zone is set on the system.
Attributes
This resource has a two attributes.
-
name
- Thename_property
of the resource. Must be unique but otherwise ignored. -
zone_name
- The name of the time zone to be configured. Must be a valid PowerShell time zone, e.g.Alaskan Standard Time
.
Recipes
win_time::default
This recipe configures possibly both time client behavior and timezone.
Attributes
Several attributes are provided for time.
Time zone attributes:
-
node['win_time']['configure_time_zone']
- Defaults totrue
. Determines if time zone is set. -
node['win_time']['time_zone']
- Defaults toAlaskan Standard Time
. Valid options are Windows PowerShell time zones.
Time server attributes:
-
node['win_time']['configure_time_server']
- Defaults totrue
. Determines if NTP/Win32tm servers are configured. -
node['win_time']['time_server_url']
- Defaults tonil
. The URL of the time server to use for NTP/Win32tm queries. Must be non-nil for the NTP server to be configured.
Examples
Custom resources can be used as below.
time_client 'UA Time Server' do server_url 'ntp.alaska.edu' end time_zone 'Alaska Zone' do zone_name 'Alaskan Standard Time' end
Development
See CONTRIBUTING.md and TESTING.md.
Dependent cookbooks
chef_run_recorder >= 0.0.0 |
windows >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Changelog for Windows DNS Cookbook
1.2.0
- Eliminated default NTP server
- Organizational changes to increase supermarket quality
1.1.0
- Upgraded for Chef 14
- Added support for Windows 2008
1.0.0
- Initial public release
Collaborator Number Metric
1.2.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
1.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.2.0 passed this metric
No Binaries Metric
1.2.0 passed this metric
Testing File Metric
1.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.2.0 failed this metric
1.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.2.0 passed this metric
No Binaries Metric
1.2.0 passed this metric
Testing File Metric
1.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.2.0 passed this metric
1.2.0 passed this metric
Testing File Metric
1.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.2.0 failed this metric
1.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number