class reboot_new_kernel {

	if !$reboot_schedule {
	# can be "daily", "weekly" or "monthly"
		$reboot_schedule = "daily"
		$reboot_hour = 21
		$reboot_dow = 6 # day of week, used with schedule "weekly"
		$reboot_dom = 1 # day of month, used with schedule "monthly"
	}
	if !$kernel_package {
		$kernel_package = "linux-image-server"
	}	

	file {
		"/usr/local/sbin/reboot_new_kernel":
			mode => 755, owner => root, group => root,
			ensure => present,
			source => "puppet:///modules/reboot_new_kernel/reboot_new_kernel"
	}

	file {
		"/etc/cron.d/reboot_new_kernel":
			mode => 644, owner => root, group => root,
			ensure => present,
			content => template("reboot_new_kernel/cron.erb"),
	}
}
