Puppet/clases

De FESOL. Proyectos de Software Libre ULS
Saltar a: navegación, buscar

Sincronización de hora

class ntp {
	package { ntp: 
		ensure => present,
	}
	file { "/etc/ntp.conf":
		owner	 => root,
 		group	 => root,
		mode	=> 444,
		backup => false,
		source	=> "puppet:///uesconfigs/etc/ntp.conf",
		require => Package["ntp"],
	}
	service { "ntp":
		enable => true ,
		ensure => running,
		subscribe => [Package[ntp], File["/etc/ntp.conf"],],
	}
}

Archivo ntp.conf, asumiendo que los servidores de hora son 192.168.0.132 y 192.168.0.133

driftfile /var/lib/ntp/ntp.drift
statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
server 192.168.0.132
server 192.168.0.133
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
restrict 127.0.0.1
restrict ::1