]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
add ntp module
authorStephen Gran <steve@lobefin.net>
Tue, 13 Oct 2009 21:20:38 +0000 (22:20 +0100)
committerStephen Gran <steve@lobefin.net>
Tue, 13 Oct 2009 21:20:38 +0000 (22:20 +0100)
Signed-off-by: Stephen Gran <steve@lobefin.net>
manifests/site.pp
modules/debian-org/manifests/init.pp
modules/ntp/files/client.conf [new file with mode: 0644]
modules/ntp/files/server.conf [new file with mode: 0644]
modules/ntp/manifests/client.pp [new file with mode: 0644]
modules/ntp/manifests/init.pp [new file with mode: 0644]
modules/ntp/manifests/server.pp [new file with mode: 0644]

index af7c23d9c73b278aac50d85d2f512996f7cd4654..856696f931c36a0c009e670a8bd558f5512fc3c8 100644 (file)
@@ -75,8 +75,12 @@ node default {
 
      case $hostname {
          geo1,geo2,geo3:
-                    { include geodns }
-         default:   {}
+                    {
+                      include geodns
+                      include ntp::server
+                    }
+         default:   {
+                    }
      }
      case $brokenhosts {
          "true":    { include hosts }
index d56db42adac49e9ac4980dd8bb134da69362ca6d..4dca10d0c27315a91f96dfa41b960942218df280 100644 (file)
@@ -25,7 +25,6 @@ class debian-org {
              "pdksh": ensure => installed;
              "ksh": ensure => installed;
              "csh": ensure => installed;
-             "ntp": ensure => installed;
              "locales-all": ensure => installed;
              "libpam-pwdfile": ensure => installed;
              "vim": ensure => installed;
diff --git a/modules/ntp/files/client.conf b/modules/ntp/files/client.conf
new file mode 100644 (file)
index 0000000..729f2c8
--- /dev/null
@@ -0,0 +1,21 @@
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+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 geo1.debian.org iburst dynamic
+server geo2.debian.org iburst dynamic
+server geo3.debian.org iburst dynamic
+
+restrict -4 default kod notrap nomodify nopeer noquery
+restrict -6 default kod notrap nomodify nopeer noquery
+
+restrict 127.0.0.1
+restrict ::1
diff --git a/modules/ntp/files/server.conf b/modules/ntp/files/server.conf
new file mode 100644 (file)
index 0000000..6511b02
--- /dev/null
@@ -0,0 +1,22 @@
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+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 0.debian.pool.ntp.org iburst dynamic
+server 1.debian.pool.ntp.org iburst dynamic
+server 2.debian.pool.ntp.org iburst dynamic
+server 3.debian.pool.ntp.org iburst dynamic
+
+restrict -4 default kod notrap nomodify nopeer noquery
+restrict -6 default kod notrap nomodify nopeer noquery
+
+restrict 127.0.0.1
+restrict ::1
diff --git a/modules/ntp/manifests/client.pp b/modules/ntp/manifests/client.pp
new file mode 100644 (file)
index 0000000..cc6964b
--- /dev/null
@@ -0,0 +1,11 @@
+class ntp::client inherits ntp {
+       file { "/etc/ntp.conf":
+               owner   => root,
+               group   => root,
+               mode    => 440,
+               source  => [ "puppet:///ntp/client.conf" ],
+               notify  => Exec["ntp restart"],
+               require => Package["ntp"]
+               ;
+       }
+}
diff --git a/modules/ntp/manifests/init.pp b/modules/ntp/manifests/init.pp
new file mode 100644 (file)
index 0000000..1b02a83
--- /dev/null
@@ -0,0 +1,14 @@
+class ntp {
+       package { ntp: ensure => installed }
+       file { "/var/lib/ntp/":
+               ensure  => directory,
+               owner   => ntp,
+               group   => ntp,
+               mode    => 755
+               ;
+       }
+       exec { "ntp restart":
+               path        => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
+               refreshonly => true,
+       }
+}
diff --git a/modules/ntp/manifests/server.pp b/modules/ntp/manifests/server.pp
new file mode 100644 (file)
index 0000000..cc5b3dc
--- /dev/null
@@ -0,0 +1,17 @@
+class ntp::server inherits ntp {
+       file { "/etc/ntp.conf":
+               owner   => root,
+               group   => root,
+               mode    => 440,
+               source  => [ "puppet:///ntp/server.conf" ],
+               notify  => Exec["ntp restart"],
+               require => Package["ntp"]
+               ;
+               "/var/lib/ntpstats":
+               ensure  => directory,
+               owner   => ntp,
+               group   => ntp,
+               mode    => 755
+               ;
+       }
+}