summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-02-15 21:45:06 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-02-15 21:45:06 +0100
commit63b3abd94c2f079ef2d8bc8e789d5e4faee5207c (patch)
tree44ec69d65ba8051df9ecea4ac44f9c8b58e1702a
parentd291d8ec07428493552aa3441d68b8ff2530e661 (diff)
downloadpuppet.SGM-63b3abd94c2f079ef2d8bc8e789d5e4faee5207c.tar.gz
puppet.SGM-63b3abd94c2f079ef2d8bc8e789d5e4faee5207c.tar.bz2
puppet.SGM-63b3abd94c2f079ef2d8bc8e789d5e4faee5207c.zip
site.pp: Add cups_browsed_polling class and enable it where appropriate.
-rw-r--r--code/environments/production/manifests/site.pp62
1 files changed, 62 insertions, 0 deletions
diff --git a/code/environments/production/manifests/site.pp b/code/environments/production/manifests/site.pp
index 4254c75..f312102 100644
--- a/code/environments/production/manifests/site.pp
+++ b/code/environments/production/manifests/site.pp
@@ -48,6 +48,63 @@ class ssh_pubkeys_backupserver {
}
}
+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':
ensure => 'latest',
@@ -201,6 +258,7 @@ node "disklserver.intern" {
}
class { 'itzks_systems_disklserver': }
class { 'itzks_systems_common': }
+ class { 'cups_browsed_polling': }
class { 'krb5hostkeytab': }
}
@@ -223,6 +281,7 @@ node "faiserver.intern" {
}
class { 'itzks_systems_faiserver': }
class { 'itzks_systems_common': }
+ class { 'cups_browsed_polling': }
class { 'krb5hostkeytab': }
}
@@ -290,6 +349,7 @@ node /(md-lap-[0-9]+|notebook-[0-9]+|test-notebook)\.intern$/ {
class { 'itzks_systems_roamingworkstation': }
class { 'itzks_systems_common': }
class { 'login_manager': }
+ class { 'cups_browsed_polling': }
class { 'krb5hostkeytab': }
}
@@ -315,6 +375,7 @@ node /(workstation-[0-9]+|test-workstation)\.intern$/ {
class { 'itzks_systems_workstation': }
class { 'itzks_systems_common': }
class { 'login_manager': }
+ class { 'cups_browsed_polling': }
class { 'krb5hostkeytab': }
}
@@ -337,6 +398,7 @@ node /(tab-[0-9]+|test-tablet)\.intern$/ {
}
class { 'itzks_systems_tablet': }
class { 'itzks_systems_common': }
+ class { 'cups_browsed_polling': }
class { 'krb5hostkeytab': }
}