Skip to content

Instantly share code, notes, and snippets.

@masterzen
Created March 5, 2010 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masterzen/322744 to your computer and use it in GitHub Desktop.
Save masterzen/322744 to your computer and use it in GitHub Desktop.
# syslog
class syslog {
file {
"/etc/cron.daily/sysklogd":
ensure => absent;
}
file {
"/etc/syslog.conf":
owner => root, group => adm, mode => 0640,
ensure => file;
}
file {
"/etc/logrotate.d/syslog":
owner => root, group => root, mode => 0644,
}
file {
"/etc/default/syslogd":
owner => root, group => root, mode => 0644,
}
}
class syslog::logger inherits syslog {
service {
"sysklogd":
hasrestart => true, ensure => running, pattern => "syslogd";
}
File["/etc/syslog.conf"] { notify => Service["sysklogd"] }
File["/etc/default/syslogd"] { notify => Service["sysklogd"] }
}
class syslog::loghost inherits syslog::logger {
File["/etc/logrotate.d/syslog"] { source => "puppet:///syslog/logrotate.loghost" }
File["/etc/syslog.conf"] { content => template("syslog/syslog.conf.loghost") }
File["/etc/default/syslogd"] { source => "puppet:///syslog/syslogd.default.loghgost" }
}
class syslog::client inherits syslog::logger {
File["/etc/logrotate.d/syslog"] { source => "puppet:///syslog/logrotate.client" }
File["/etc/syslog.conf"] { content => template("syslog/syslog.conf.client") }
}
class rsyslog::client inherits syslog {
package { "rsyslog": ensure => installed; }
service{ "rsyslog":
ensure => running, hasrestart => true, pattern => "rsyslogd"
}
File["/etc/syslog.conf"] { path => "/etc/rsyslog.conf", content => template("syslog/rsyslog.conf.client"), notify => Service['rsyslog'] }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment