puppet manifest for ntp

Clase ntp:
class ntp {
   package { "ntp":
      ensure     => installed;
   }

   group { "ntp":
      ensure     => present;
   }

   define ntpconf ($ntpserver = [ "0.debian.pool.ntp.org" ]) {
      file { "/etc/ntp.conf":
         owner   => root,
         group   => root,
         mode    => 644,
         content => template("ntp.conf.erb"),
         require => Package[ "ntp" ],
         notify  => Service[ "ntp" ];
      }
   }

   service { "ntp":
      name       => $operatingsystem ?{
         debian  => "ntp",
         ubuntu  => "ntp",
         default => "ntpd",
      },
      ensure     => running,
      enable     => true,
      provider   => debian,
      subscribe  => File[ "/etc/ntp.conf" ];
   }
}
Y la forma de usarlo,
include ntp
ntp::ntpconf { "ntp":
   ntpserver => [ "0.debian.pool.ntp.org", "127.0.0.1" ]
}


No hay comentarios :

Publicar un comentario

Formulario de contacto

Nombre

Correo electrónico *

Mensaje *

Últimos comentarios