Permalink
Browse files

merged with upstream, cleaned up, added useflags

  • Loading branch information...
2 parents ef645f7 + 0ab821c commit aef6822fe4260c088a437aa01b362f30dec7f541 Marcel Haerry committed May 13, 2008
Showing with 48 additions and 41 deletions.
  1. +0 −1 files/.git_placeholder
  2. +0 −11 files/fix_munin
  3. +21 −29 manifests/init.pp
  4. +18 −0 manifests/selinux.pp
  5. +9 −0 manifests/xenu.pp
View
@@ -1 +0,0 @@
-# file needed for git - don't remove it
View
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-set -e
-
-cd /etc/munin/plugins
-rm -f ntp_*
-for i in $(grep -hE '^(server|peer)' /etc/ntp.*.conf | cut -d ' ' -f 2)
-do
- ln -s /var/lib/puppet/modules/ntp/munin_plugin ntp_$i
-done
-
View
@@ -20,6 +20,14 @@
openbsd: { include ntp::openbsd }
default: { fail("no classes for this kernel yet defined!") }
}
+
+ if $selinux {
+ include ntp::selinux
+ }
+
+ case $virtual {
+ 'xenu': { include ntp::xenu }
+ }
}
class ntp::base {
@@ -50,45 +58,27 @@
subscribe => [ File["/etc/ntp.conf"], File["/etc/ntp.client.conf"], File["/etc/ntp.server.conf"] ],
}
- # various files and directories used by this module
- file{"${ntp_base_dir}/munin_plugin":
+ if $use_munin {
+ # various files and directories used by this module
+ file{"${ntp_base_dir}/munin_plugin":
source => "puppet://$server/ntp/ntp_",
mode => 0755, owner => root, group => 0;
- }
+ }
- $ntps = gsub(split($configured_ntp_servers, " "), "(.+)", "ntp_\\1")
- munin::plugin { $ntps:
- ensure => "munin_plugin",
- script_path_in => $ntp_base_dir
- }
+ $ntps = gsub(split($configured_ntp_servers, " "), "(.+)", "ntp_\\1")
+ munin::plugin { $ntps:
+ ensure => "munin_plugin",
+ script_path_in => $ntp_base_dir
+ }
+ }
case $ntp_servers {
'': { include ntp::client }
default: { include ntp::server }
}
# collect all our configs
File <<| tag == 'ntp' |>>
-
-
-
-
- # private
- # Installs a munin plugin and configures it for a given host
- define munin_plugin() {
-
- $name_with_underscores = gsub($name, "\\.", "_")
-
- # replace the "legacy" munin plugin with our own
- munin::plugin {
- "ntp_${name_with_underscores}": ensure => absent;
- "ntp_${name}":
- ensure => "munin_plugin",
- script_path => "/var/lib/puppet/modules/ntp"
- ;
- }
- }
-
}
define ntp::upstream_server($server_options = 'iburst') {
@@ -141,7 +131,9 @@
}
config_file { "/etc/ntp.client.conf": content => "\n", }
- include nagios::service::ntp
+ if $use_nagios {
+ include nagios::service::ntp
+ }
}
# this is a client, connect to our own servers
View
@@ -0,0 +1,18 @@
+# manifests/selinux.pp
+
+class ntp::selinux {
+ case $operatingsystem {
+ gentoo: { include ntp::selinux::gentoo }
+ default: { info("No selinux stuff yet defined for your operatingsystem") }
+ }
+}
+
+class ntp::selinux::gentoo {
+ package{'selinux-ntp':
+ ensure => present,
+ category => 'sec-policy',
+ require => Package[ntp],
+ }
+ selinux::loadmodule {"ntp": require => Package[selinux-ntp] }
+}
+
View
@@ -0,0 +1,9 @@
+# manifests/xenu.pp
+
+# on domU's we should set the clock to independent
+
+class ntp::xenu {
+ exec{"echo 1 > /proc/sys/xen/independent_wallclock":
+ unless => "grep -q 1 /proc/sys/xen/independent_wallclock",
+ }
+}

0 comments on commit aef6822

Please sign in to comment.