cups: Changed cups::server to use template file as config.
This commit is contained in:
parent
e56702c0d0
commit
6980e8275b
3 changed files with 177 additions and 94 deletions
|
@ -55,20 +55,56 @@ class cups::client {
|
|||
|
||||
# Install cups server
|
||||
#
|
||||
class cups::server inherits cups::client {
|
||||
# === Parameters:
|
||||
#
|
||||
# $admin_group:
|
||||
# Group name which is allowed to modify printers.
|
||||
#
|
||||
# $manager_group:
|
||||
# Group name which is allowed to remove jobs from print
|
||||
# queues.
|
||||
#
|
||||
# $ssl_cert:
|
||||
# Path to SSL certificate. Defaults to auto generated
|
||||
# certificate.
|
||||
#
|
||||
# $ssl_key:
|
||||
# Path to SSL key. Defaults to auto generated key.
|
||||
#
|
||||
class cups::server($admin_group=undef, $manager_group=undef,
|
||||
$ssl_cert=undef, $ssl_key=undef) inherits cups::client {
|
||||
|
||||
require ssl
|
||||
|
||||
package { [ "ghostscript", "system-config-printer" ]:
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
if $ssl_key and $ssl_cert {
|
||||
file { "${ssl::private}/cups.key":
|
||||
ensure => present,
|
||||
source => $ssl_key,
|
||||
mode => "0600",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
notify => Service["cups"],
|
||||
}
|
||||
file { "${ssl::certs}/cups.crt":
|
||||
ensure => present,
|
||||
source => $ssl_cert,
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
notify => Service["cups"],
|
||||
}
|
||||
}
|
||||
|
||||
file { "/etc/cups/cupsd.conf":
|
||||
ensure => present,
|
||||
source => [ "puppet:///files/cups/cupsd.conf.${::homename}",
|
||||
"puppet:///files/cups/cupsd.conf",
|
||||
"puppet:///modules/cups/cupsd.conf", ],
|
||||
content => template("cups/cupsd.conf.erb"),
|
||||
mode => "0640",
|
||||
owner => root,
|
||||
group => lp,
|
||||
owner => "root",
|
||||
group => "lp",
|
||||
require => Package["cups"],
|
||||
notify => Service["cups"],
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue