summaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-02-15 21:50:49 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-02-15 21:50:49 +0100
commit40236de30e742094fa7e8fbaaac34995121f6466 (patch)
tree09fd958b2a395814d5db49b8f60aca45dbc40483 /code
parenta128d4d84df12c627bac321753da7026bee624a8 (diff)
downloadpuppet.FWSECK-40236de30e742094fa7e8fbaaac34995121f6466.tar.gz
puppet.FWSECK-40236de30e742094fa7e8fbaaac34995121f6466.tar.bz2
puppet.FWSECK-40236de30e742094fa7e8fbaaac34995121f6466.zip
site.pp: Add cups_browsed_polling class and enable it where appropriate.
Diffstat (limited to 'code')
-rw-r--r--code/environments/production/manifests/site.pp58
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': }
}