Initial version of cups module.
This commit is contained in:
parent
d016eeecb2
commit
610f33e506
20 changed files with 615 additions and 0 deletions
119
cups/manifests/init.pp
Normal file
119
cups/manifests/init.pp
Normal file
|
@ -0,0 +1,119 @@
|
|||
|
||||
# Install and configure cups client
|
||||
#
|
||||
class cups::client {
|
||||
|
||||
package { "cups":
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
file { "/etc/cups/client.conf":
|
||||
ensure => present,
|
||||
content => template("cups/client.conf.erb"),
|
||||
mode => 0644,
|
||||
owner => root,
|
||||
group => lp,
|
||||
require => Package["cups"],
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# Install cups server
|
||||
#
|
||||
class cups::server inherits cups::client {
|
||||
|
||||
package { [ "ghostscript", "system-config-printer" ]:
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
service { "cups":
|
||||
ensure => running,
|
||||
enable => true,
|
||||
require => Package["cups"],
|
||||
}
|
||||
|
||||
File["/etc/cups/client.conf"] {
|
||||
content => "ServerName 127.0.0.1\n",
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Install samba support into cups
|
||||
#
|
||||
class cups::samba {
|
||||
|
||||
include samba::server
|
||||
|
||||
file { [ "/etc/samba/drivers",
|
||||
"/usr/share/cups/drivers",
|
||||
"/usr/share/cups/drivers/x64", ]:
|
||||
ensure => directory,
|
||||
mode => 0755,
|
||||
owner => root,
|
||||
group => root,
|
||||
require => [ Package["samba"],
|
||||
Package["cups"], ],
|
||||
}
|
||||
|
||||
define driverfile() {
|
||||
file { "/usr/share/cups/drivers/${name}":
|
||||
ensure => present,
|
||||
source => "puppet:///cups/drivers/${name}",
|
||||
mode => 0644,
|
||||
owner => root,
|
||||
group => root,
|
||||
require => [ File["/usr/share/cups/drivers"],
|
||||
File["/usr/share/cups/drivers/x64"], ],
|
||||
}
|
||||
}
|
||||
|
||||
driverfile { "cups6.inf": }
|
||||
driverfile { "cups6.ini": }
|
||||
driverfile { "cupsps6.dll": }
|
||||
driverfile { "cupsui6.dll": }
|
||||
|
||||
driverfile { "ps5ui.dll": }
|
||||
driverfile { "pscript.hlp": }
|
||||
driverfile { "pscript.ntf": }
|
||||
driverfile { "pscript5.dll": }
|
||||
|
||||
driverfile { "x64/cups6.inf": }
|
||||
driverfile { "x64/cups6.ini": }
|
||||
driverfile { "x64/cupsps6.dll": }
|
||||
driverfile { "x64/cupsui6.dll": }
|
||||
|
||||
driverfile { "x64/ps5ui.dll": }
|
||||
driverfile { "x64/pscript.hlp": }
|
||||
driverfile { "x64/pscript.ntf": }
|
||||
driverfile { "x64/pscript5.dll": }
|
||||
|
||||
file { "/etc/cron.hourly/update-printer-inf.sh":
|
||||
ensure => present,
|
||||
source => "puppet:///cups/update-printer-inf.sh",
|
||||
mode => 0755,
|
||||
owner => root,
|
||||
group => root,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Install SNMP polling into cups server
|
||||
#
|
||||
class cups::snmp {
|
||||
|
||||
package { "net-snmp-utils":
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
file { "/etc/cron.hourly/printer-details.py":
|
||||
ensure => present,
|
||||
source => "puppet:///cups/printer-details.py",
|
||||
mode => 0755,
|
||||
owner => root,
|
||||
group => root,
|
||||
require => Package["net-snmp-utils"],
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue