diff options
author | Ashley Penney <ashley.penney@puppetlabs.com> | 2013-07-05 17:56:14 -0400 |
---|---|---|
committer | Ashley Penney <ashley.penney@puppetlabs.com> | 2013-07-05 18:53:54 -0400 |
commit | b47ce3980fe62cf25a72ee71fd96a8eb0c915e0d (patch) | |
tree | 2a391f2fd2f57880bdb64191f63143006af1f01e /manifests/service.pp | |
parent | e6d35855e0208e7fc54a085316fd11a1dba13d18 (diff) |
Add ntp::service, a class to manage the ntp service.
Diffstat (limited to 'manifests/service.pp')
-rw-r--r-- | manifests/service.pp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/manifests/service.pp b/manifests/service.pp new file mode 100644 index 0000000..aea661d --- /dev/null +++ b/manifests/service.pp @@ -0,0 +1,20 @@ +class ntp::service ( + $ensure_service = $ntp::ensure_service, + $enable_service = $ntp::enable_service, + $service_name = $ntp::service_name, +) { + + if ! ($ensure_service in [ 'running', 'stopped' ]) { + fail('ensure_service parameter must be running or stopped') + } + validate_bool($enable_service) + + service { 'ntp': + ensure => $ensure_service, + enable => $enable_service, + name => $service_name, + hasstatus => true, + hasrestart => true, + } + +} |