1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# Class: ntp
#
# This module manages the ntp service.
#
# Jeff McCune <jeff@puppetlabs.com>
# 2011-02-23
#
# Tested platforms:
# - Debian 6.0 Squeeze
# - CentOS 5.4
# - Amazon Linux 2011.09
# - FreeBSD 9.0
# - Archlinux
#
# Parameters:
#
# $servers = [ '0.debian.pool.ntp.org iburst',
# '1.debian.pool.ntp.org iburst',
# '2.debian.pool.ntp.org iburst',
# '3.debian.pool.ntp.org iburst', ]
#
# $restrict = true
# Whether to restrict ntp daemons from allowing others to use as a server.
#
# $autoupdate = false
# Whether to update the ntp package automatically or not.
#
# $enable = true
# Automatically start ntp deamon on boot.
#
# $template = '${module_name}/${config_tpl}'
# Override with your own explicit template.
#
# Actions:
#
# Installs, configures, and manages the ntp service.
#
# Requires:
#
# Sample Usage:
#
# class { "ntp":
# servers => [ 'time.apple.com' ],
# autoupdate => false,
# }
#
# [Remember: No empty lines between comments and class definition]
class ntp(
$autoupdate = $ntp::params::autoupdate,
$config = $ntp::params::config,
$config_template = $ntp::params::config_template,
$enable_service = $ntp::params::enable_service,
$ensure_package = $ntp::params::ensure_package,
$ensure_service = $ntp::params::ensure_service,
$manage_service = $ntp::params::manage_service,
$package_name = $ntp::params::package_name,
$restrict = $ntp::params::restrict,
$servers = $ntp::params::servers,
$service_name = $ntp::params::service_name,
) inherits ntp::params {
if $autoupdate {
notice('autoupdate parameter has been deprecated and replaced with ensure_package. Set this to latest for the same behavior as autoupdate => true.')
}
include '::ntp::install'
include '::ntp::config'
include '::ntp::service'
# Anchor this as per #8140 - this ensures that classes won't float off and
# mess everything up. You can read about this at:
# http://docs.puppetlabs.com/puppet/2.7/reference/lang_containment.html#known-issues
anchor { 'ntp::begin': }
anchor { 'ntp::end': }
Anchor['ntp::begin'] -> Class['::ntp::install'] -> Class['::ntp::config']
~> Class['::ntp::service'] -> Anchor['ntp::end']
}
|