Puppet Class: openntpd

Inherits:
openntpd::params
Inherited by:
openntpd::config
openntpd::install
openntpd::service
Defined in:
manifests/init.pp

Overview

Class: openntpd

Parameters:

  • package_manage (Any) (defaults to: $openntpd::params::package_manage)
  • package_ensure (Any) (defaults to: $openntpd::params::package_ensure)
  • package_name (Any) (defaults to: $openntpd::params::package_name)
  • service_manage (Any) (defaults to: $openntpd::params::service_manage)
  • service_ensure (Any) (defaults to: $openntpd::params::service_ensure)
  • service_name (Any) (defaults to: $openntpd::params::service_name)
  • config_manage (Any) (defaults to: $openntpd::params::config_manage)
  • config_file (Any) (defaults to: $openntpd::params::config_file)
  • config_template (Any) (defaults to: $openntpd::params::config_template)
  • servers (Any) (defaults to: $openntpd::params::servers)
  • listen (Any) (defaults to: $openntpd::params::listen)


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
# File 'manifests/init.pp', line 3

class openntpd (

  $package_manage  = $openntpd::params::package_manage,
  $package_ensure  = $openntpd::params::package_ensure,
  $package_name    = $openntpd::params::package_name,

  $service_manage  = $openntpd::params::service_manage,
  $service_ensure  = $openntpd::params::service_ensure,
  $service_name    = $openntpd::params::service_name,

  $config_manage   = $openntpd::params::config_manage,
  $config_file     = $openntpd::params::config_file,
  $config_template = $openntpd::params::config_template,

  $servers         = $openntpd::params::servers,
  $listen          = $openntpd::params::listen,

) inherits openntpd::params {

  validate_bool($package_manage)
  validate_re($package_ensure, '^installed|latest|absent$')
  validate_string($package_name)

  validate_bool($service_manage)
  validate_re($service_ensure, '^running|stopped$')
  validate_string($service_name)

  validate_bool($config_manage)
  validate_absolute_path($config_file)
  validate_string($config_template)

  validate_array($servers)

  # Be able to specify a string or list of strings, or nothing at all (to array style)
  if is_string($listen) {
    $real_listen = [$listen]
  } else {
    $real_listen = $listen
  }
  validate_array($real_listen)

  # http://docs.puppetlabs.com/puppet/2.7/reference/lang_containment.html#known-issues
  anchor { 'openntpd::begin': } ->
  class { '::openntpd::install': } ->
  class { '::openntpd::config': } ~>
  class { '::openntpd::service': } ->
  anchor { 'openntpd::end': }

}