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,
}
service { 'ntp':
name => $service_name,
ensure => running,
enable => true,
subscribe => File['ntp.conf'],
}
file { 'ntp.conf':
path => '/etc/ntp.conf',
ensure => file,
require => Package['ntp'],
source => "/root/learning-manifests/${conf_file}",
}
}
Sunday, May 26, 2013
Review of Puppet NTP
Posting an example which helps me remember what I learned about puppet a week ago; an NTP class which hasn't yet been converted into a module from Learning — Modules and Classes (Part One). I borrowed the HTML/CSS from puppetlabs.com.
Subscribe to:
Post Comments (Atom)
1 comment:
Thanks for sharing this recipe!
Post a Comment