Skip to content

Instantly share code, notes, and snippets.

@mieciu
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mieciu/b3cd145ffad5eacc72bb to your computer and use it in GitHub Desktop.
Save mieciu/b3cd145ffad5eacc72bb to your computer and use it in GitHub Desktop.
class ntp {
case $::operatingsystem {
'CentOS', 'Redhat': {
$service_name = 'ntpd'
$conf_file = 'ntp.conf.el'
}
'Debian', 'Ubuntu': {
$service_name = 'ntp'
$conf_file = 'ntp.conf.debian'
}
}
package { 'ntp':
ensure => installed,
}
file { 'ntp.conf':
path => '/etc/ntp.conf',
ensure => file,
require => Package['ntp'],
source => "/root/examples/answers/${conf_file}"
}
service { 'ntp':
name => $service_name,
ensure => running,
enable => true,
subscribe => File['ntp.conf'],
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment