|
1 | 1 | class ntp (
|
2 |
| - $autoupdate = $ntp::params::autoupdate, |
3 |
| - $broadcastclient = $ntp::params::broadcastclient, |
4 |
| - $config = $ntp::params::config, |
5 |
| - $config_dir = $ntp::params::config_dir, |
6 |
| - $config_file_mode = $ntp::params::config_file_mode, |
7 |
| - $config_template = $ntp::params::config_template, |
8 |
| - $disable_auth = $ntp::params::disable_auth, |
9 |
| - $disable_dhclient = $ntp::params::disable_dhclient, |
10 |
| - $disable_kernel = $ntp::params::disable_kernel, |
11 |
| - $disable_monitor = $ntp::params::disable_monitor, |
12 |
| - $fudge = $ntp::params::fudge, |
13 |
| - $driftfile = $ntp::params::driftfile, |
14 |
| - $leapfile = $ntp::params::leapfile, |
15 |
| - $logfile = $ntp::params::logfile, |
16 |
| - $iburst_enable = $ntp::params::iburst_enable, |
17 |
| - $keys = $ntp::params::keys, |
18 |
| - $keys_enable = $ntp::params::keys_enable, |
19 |
| - $keys_file = $ntp::params::keys_file, |
20 |
| - $keys_controlkey = $ntp::params::keys_controlkey, |
21 |
| - $keys_requestkey = $ntp::params::keys_requestkey, |
22 |
| - $keys_trusted = $ntp::params::keys_trusted, |
23 |
| - $minpoll = $ntp::params::minpoll, |
24 |
| - $maxpoll = $ntp::params::maxpoll, |
25 |
| - $package_ensure = $ntp::params::package_ensure, |
26 |
| - $package_manage = $ntp::params::package_manage, |
27 |
| - $package_name = $ntp::params::package_name, |
28 |
| - $panic = $ntp::params::panic, |
29 |
| - $peers = $ntp::params::peers, |
30 |
| - $preferred_servers = $ntp::params::preferred_servers, |
31 |
| - $restrict = $ntp::params::restrict, |
32 |
| - $interfaces = $ntp::params::interfaces, |
33 |
| - $interfaces_ignore = $ntp::params::interfaces_ignore, |
34 |
| - $servers = $ntp::params::servers, |
35 |
| - $service_enable = $ntp::params::service_enable, |
36 |
| - $service_ensure = $ntp::params::service_ensure, |
37 |
| - $service_manage = $ntp::params::service_manage, |
38 |
| - $service_name = $ntp::params::service_name, |
39 |
| - $service_provider = $ntp::params::service_provider, |
40 |
| - $stepout = $ntp::params::stepout, |
41 |
| - $step_tickers_file = $ntp::params::step_tickers_file, |
42 |
| - $step_tickers_template = $ntp::params::step_tickers_template, |
43 |
| - $tinker = $ntp::params::tinker, |
44 |
| - $tos = $ntp::params::tos, |
45 |
| - $tos_minclock = $ntp::params::tos_minclock, |
46 |
| - $tos_minsane = $ntp::params::tos_minsane, |
47 |
| - $tos_floor = $ntp::params::tos_floor, |
48 |
| - $tos_ceiling = $ntp::params::tos_ceiling, |
49 |
| - $tos_cohort = $ntp::params::tos_cohort, |
50 |
| - $udlc = $ntp::params::udlc, |
51 |
| - $udlc_stratum = $ntp::params::udlc_stratum, |
52 |
| - $ntpsigndsocket = $ntp::params::ntpsigndsocket, |
53 |
| - $authprov = $ntp::params::authprov, |
54 |
| -) inherits ntp::params { |
| 2 | + $autoupdate, |
| 3 | + $broadcastclient, |
| 4 | + $config, |
| 5 | + $config_dir, |
| 6 | + $config_file_mode, |
| 7 | + $config_template, |
| 8 | + $disable_auth, |
| 9 | + $disable_dhclient, |
| 10 | + $disable_kernel, |
| 11 | + $disable_monitor, |
| 12 | + $fudge, |
| 13 | + $driftfile, |
| 14 | + $leapfile, |
| 15 | + $logfile, |
| 16 | + $iburst_enable, |
| 17 | + $keys, |
| 18 | + $keys_enable, |
| 19 | + $keys_file, |
| 20 | + $keys_controlkey, |
| 21 | + $keys_requestkey, |
| 22 | + $keys_trusted, |
| 23 | + $minpoll, |
| 24 | + $maxpoll, |
| 25 | + $package_ensure, |
| 26 | + $package_manage, |
| 27 | + $package_name, |
| 28 | + $panic, |
| 29 | + $peers, |
| 30 | + $preferred_servers, |
| 31 | + $restrict, |
| 32 | + $interfaces, |
| 33 | + $interfaces_ignore, |
| 34 | + $servers, |
| 35 | + $service_enable, |
| 36 | + $service_ensure, |
| 37 | + $service_manage, |
| 38 | + $service_name, |
| 39 | + $service_provider, |
| 40 | + $stepout, |
| 41 | + $step_tickers_file, |
| 42 | + $step_tickers_template, |
| 43 | + $tinker, |
| 44 | + $tos, |
| 45 | + $tos_minclock, |
| 46 | + $tos_minsane, |
| 47 | + $tos_floor, |
| 48 | + $tos_ceiling, |
| 49 | + $tos_cohort, |
| 50 | + $udlc, |
| 51 | + $udlc_stratum, |
| 52 | + $ntpsigndsocket, |
| 53 | + $authprov, |
| 54 | +) { |
55 | 55 |
|
56 | 56 | validate_bool($broadcastclient)
|
57 | 57 | validate_absolute_path($config)
|
|
75 | 75 | validate_string($package_ensure)
|
76 | 76 | validate_bool($package_manage)
|
77 | 77 | validate_array($package_name)
|
78 |
| - if $panic { validate_numeric($panic, 65535, 0) } |
79 | 78 | validate_array($preferred_servers)
|
80 | 79 | validate_array($restrict)
|
81 | 80 | validate_array($interfaces)
|
|
90 | 89 | validate_string($step_tickers_file)
|
91 | 90 | validate_string($step_tickers_template)
|
92 | 91 | }
|
93 |
| - validate_bool($tinker) |
94 | 92 | validate_bool($tos)
|
95 | 93 | if $tos_minclock { validate_numeric($tos_minclock) }
|
96 | 94 | if $tos_minsane { validate_numeric($tos_minsane) }
|
|
109 | 107 | notice('ntp: autoupdate parameter has been deprecated and replaced with package_ensure. Set package_ensure to latest for the same behavior as autoupdate => true.')
|
110 | 108 | }
|
111 | 109 |
|
| 110 | + # defaults for tinker and panic are different, when running on virtual machines |
| 111 | + if str2bool($::is_virtual) { |
| 112 | + $_tinker = pick($tinker, true) |
| 113 | + $_panic = pick($panic, 0) |
| 114 | + } else { |
| 115 | + $_tinker = pick($tinker, false) |
| 116 | + $_panic = $panic |
| 117 | + } |
| 118 | + |
| 119 | + validate_bool($_tinker) |
| 120 | + if $_panic != undef { validate_numeric($_panic, 65535, 0) } |
| 121 | + |
| 122 | + |
112 | 123 | # Anchor this as per #8040 - this ensures that classes won't float off and
|
113 | 124 | # mess everything up. You can read about this at:
|
114 | 125 | # http://docs.puppetlabs.com/puppet/2.7/reference/lang_containment.html#known-issues
|
|
0 commit comments