diff --git a/cups/manifests/init.pp b/cups/manifests/init.pp index 23bdebd..bb10f32 100644 --- a/cups/manifests/init.pp +++ b/cups/manifests/init.pp @@ -101,6 +101,8 @@ class cups::server inherits cups::client { # Printer name. # $uri: # URI to use for connecting to printer device. +# $location: +# Printer location. Use "LDAP" to fetch location information from LDAP. # $ensure: # If set to present printer will be installed and if set to absent # printer will be removed. @@ -112,10 +114,15 @@ class cups::server inherits cups::client { # uri => "socket://hp1:9100, # } # -define cups::printer($uri, $ensure = present) { +define cups::printer($uri, $location = "", $ensure = present) { $hostname = regsubst($uri, '^[a-z]*://(.*)[:/].*', '\1') - $location = template("cups/printer-location.erb") + + if $location == "LDAP" { + $_location = template("cups/printer-location.erb") + } else { + $_location = $location + } case $ensure { present: { @@ -128,9 +135,9 @@ define cups::printer($uri, $ensure = present) { exec { "cups-set-location-${name}": command => "lpadmin -p ${name} -L '${location}'", path => "/bin:/sbin:/usr/bin:/usr/sbin", - unless => $location ? { + unless => $_location ? { "" => "lpoptions -p ${name} | egrep ' printer-location '", - default => "lpoptions -p ${name} | egrep ' printer-location=${location} '", + default => "lpoptions -p ${name} | egrep ' printer-location=${_location} '", }, require => Exec["cups-add-printer-${name}"], } diff --git a/syslog/manifests/init.pp b/syslog/manifests/init.pp index f61a268..3359908 100644 --- a/syslog/manifests/init.pp +++ b/syslog/manifests/init.pp @@ -335,6 +335,9 @@ class syslog::standalone::syslogd inherits syslog::client::syslogd { require => [ File["/srv/log"], File["/var/log/all.log"], ], } + Service["syslogd"] { + subscribe => File["/srv/log"], + } } @@ -350,6 +353,9 @@ class syslog::standalone::rsyslog inherits syslog::client::rsyslog { require => [ File["/srv/log"], File["/var/log/all.log"], ], } + Service["rsyslog"] { + subscribe => File["/srv/log"], + } }