summaryrefslogtreecommitdiff
path: root/samba/smb-printers.conf
diff options
context:
space:
mode:
Diffstat (limited to 'samba/smb-printers.conf')
-rw-r--r--samba/smb-printers.conf59
1 files changed, 52 insertions, 7 deletions
diff --git a/samba/smb-printers.conf b/samba/smb-printers.conf
index ffbf935..4b3d448 100644
--- a/samba/smb-printers.conf
+++ b/samba/smb-printers.conf
@@ -1,7 +1,52 @@
-[printers]
- comment = %S printer
- path = /tmp
- print command = /usr/bin/lpr -h %s
- lprm command = /usr/bin/lprm -P%S %j
- public = yes
- printable = yes
+control:
+ AddInstallable = ( samba samba_reload )
+
+ #
+ # Variables for the print spooldir
+ # You can change the rights on the dir in the "directories:"
+ # section.
+ #
+ printdir = ( /var/spool/lpd/sharedprinter )
+
+editfiles:
+ samba::
+ { /etc/samba/smb-printers.conf
+ AutoCreate
+ #
+ # [netlogon]
+ #
+ BeginGroupIfNoLineMatching "^\[printers\]"
+ Append '[printers]'
+ Append ' comment = %S printer'
+ Append ' path = /tmp'
+ Append ' print command = /usr/bin/lpr -h -r %s'
+ Append ' lprm command = /usr/bin/lprm -P%S %j'
+ Append ' public = yes'
+ Append ' printable = yes'
+ EndGroup
+ DefineClasses "samba_reload"
+ }
+
+ samba_reload::
+ { /etc/samba/smb-printers.conf
+ LocateLineMatching "^; EDITED BY CFENGINE .*"
+ ReplaceAll '; EDITED BY CFENGINE .*$' With '; EDITED BY CFENGINE $(date)'
+ CatchAbort
+ BeginGroupIfNoMatch "^; EDITED BY CFENGINE .*"
+ Append '; EDITED BY CFENGINE $(date)'
+ EndGroup
+ }
+
+directories:
+ samba::
+ $(printdir)
+ mode=777
+ owmer=root
+ group=root
+
+processes:
+ "smbd" restart "/etc/init.d/samba restart"
+
+shellcommands:
+ samba_reload::
+ "/etc/init.d/samba force-reload"