diff options
Diffstat (limited to 'code/environments/production/manifests/site.pp')
-rw-r--r-- | code/environments/production/manifests/site.pp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/code/environments/production/manifests/site.pp b/code/environments/production/manifests/site.pp index abc625e..413c506 100644 --- a/code/environments/production/manifests/site.pp +++ b/code/environments/production/manifests/site.pp @@ -200,6 +200,62 @@ class no_cachefilesd { } } +class cups_browsed_polling { + + file { '/etc/apparmor.d/local/usr.sbin.cups-browsed': + content => "/etc/cups/cups-browsed-debian-edu.conf r,\n", + } + ~> exec { '/usr/bin/systemctl restart apparmor.service': refreshonly => true } + ~> exec { '/usr/bin/systemctl restart cups-browsed.service': refreshonly => true } + + exec { 'cups-browsed-reload': + command => '/usr/sbin/service cups-browsed restart', + subscribe => [File_line['cups-browsed-create-remote-cups-printers'], File_line['cups-browsed-poll-ipp-intern'], File_line['cups-browsed-queue-naming'], File_line['cups-browsed-no-remote-protos'], File_line['cups-browsed-no-local-protos']], + refreshonly => true, + } + + exec { 'cups-delete-dead-printers': + command => '/bin/bash -c "LANG=C lpstat -a | grep \"not accepting requests\" | cut -d \" \" -f1 | while read printer; do lpadmin -x \$printer; done"', + subscribe => File_line['cups-browsed-no-remote-protos'], + refreshonly => true, + } + + file_line { 'cups-browsed-create-remote-cups-printers': + path => '/etc/cups/cups-browsed.conf', + ensure => present, + line => "CreateRemoteCUPSPrinterQueues Yes", + match => '^CreateRemoteCUPSPrinterQueues.*', + } + + file_line { 'cups-browsed-no-remote-protos': + path => '/etc/cups/cups-browsed.conf', + ensure => present, + line => "BrowseRemoteProtocols none", + match => '^BrowseRemoteProtocols.*', + } + + file_line { 'cups-browsed-no-local-protos': + path => '/etc/cups/cups-browsed.conf', + ensure => present, + line => "BrowseLocalProtocols none", + match => '^BrowseLocalProtocols.*', + } + + file_line { 'cups-browsed-queue-naming': + path => '/etc/cups/cups-browsed.conf', + ensure => present, + line => "LocalQueueNamingRemoteCUPS RemoteName", + match => '^LocalQueueNamingRemoteCUPS.*', + } + + file_line { 'cups-browsed-poll-ipp-intern': + path => '/etc/cups/cups-browsed.conf', + ensure => present, + line => "BrowsePoll ipp.intern", + match => '^BrowsePoll\ .*', + append_on_no_match => true, + } +} class itzks_systems_common { package { 'itzks-systems-common': @@ -369,6 +425,7 @@ node /workstation-.*\.intern$/ { class { 'office': } class { 'browsers': } # class { 'debian_edu_config': } + class { 'cups_browsed_polling': } class { 'cachefilesd': } } @@ -402,6 +459,7 @@ node /(notebook-.*)\.intern$/ { class { 'office': } class { 'browsers': } # class { 'debian_edu_config': } + class { 'cups_browsed_polling': } class { 'apt_via_squid_deb_proxy': } } |