summaryrefslogtreecommitdiff
path: root/cfengine/cf.services.file
diff options
context:
space:
mode:
authorJuri Jensen <juri@xenux.dk>2002-01-17 00:14:39 +0000
committerJuri Jensen <juri@xenux.dk>2002-01-17 00:14:39 +0000
commit9b39f11755d95d121cecf3614710ec1e3ee1b57c (patch)
tree4da91e1b2f59595d9fb288773e21432acf883dd6 /cfengine/cf.services.file
parent86fbe4cf85f87852cba55bd83867a3a5074b93bb (diff)
cfengine: Changed $(host) to $(fqhost) in cf.services.dns. Touched up
cf.services.file. Should be more generic now. Roaming profiles for w9x should work now.
Diffstat (limited to 'cfengine/cf.services.file')
-rw-r--r--cfengine/cf.services.file123
1 files changed, 27 insertions, 96 deletions
diff --git a/cfengine/cf.services.file b/cfengine/cf.services.file
index b2ccab2..549f485 100644
--- a/cfengine/cf.services.file
+++ b/cfengine/cf.services.file
@@ -1,36 +1,11 @@
control:
AddInstallable = ( samba samba_reload netatalk netatalk_reload lprng lprng_reload cups cups_reload )
-# #
-# # Variables for shares
- # You can change the paths here and it will be changed both in
- # the conf file and in the filesystem - But once it is implemented,
- # it is not wise to change it - the data in the shares doesn't get
- # moved!
- # You can change the rights on the shares in the "directories:"
- # section.
- #
-# netlogshare = ( /etc/samba/netlogon )
-# commonsharedir = ( /home/fsadmin/COMMON )
-# datashare = ( /home/fsadmin/COMMON/documents )
-# softshare = ( /home/fsadmin/COMMON/software )
-# profshare = ( /home/fsadmin/COMMON/samba/userprofiles )
- printdir = ( /var/spool/lpd/sharedprinter )
-# privpcshare = ( .pcshare )
-# privmacshare = ( .macshare )
-# privxchngshare = ( .xchangeshare )
-
- #
- # Administrative user and group
- #
-# adminuser = ( fsadmin )
-# admingrp = ( fsadmin )
-
+classes:
#
# Determine if this is a samba server, netatalk server or both, and define
# classes based on that.
#
-classes:
samba = ( `/usr/bin/test -x /usr/sbin/smbd` )
netatalk = ( `/usr/bin/test -x /usr/sbin/afpd` )
@@ -43,13 +18,24 @@ classes:
import:
samba::
+ #
+ # Import the shares definition for this site. This is a cfengine file!
+ #
/etc/local-COMMON/samba/smb-shares-$(site).conf
+
+ lprng|cups::
+ #
+ # Set up a printershare only if there's some printersoftware installed
+ #
+ /etc/local-COMMON/samba/smb-printers.conf
editfiles:
+ samba.lprng|samba.cups::
+ { /etc/samba/smb.conf
+ AppendIfNoSuchLine "include = /etc/samba/smb-printers.conf"
+ }
+
samba::
- #
- # Samba configuration stuff.
- #
{ /etc/samba/smb.conf
#
# Global stuff
@@ -57,7 +43,6 @@ editfiles:
# Remove share declarations from main smb.conf. It is split
# up in the following files:
# - smb.conf
- # - smb-shares-COMMON.conf
# - smb-shares-$(site).conf
# - smb-printers.conf
#
@@ -69,8 +54,6 @@ editfiles:
#
# Append the include lines for the files decribed above
#
-# AppendIfNoSuchLine "include = /etc/samba/smb-shares-COMMON.conf"
- AppendIfNoSuchLine "include = /etc/samba/smb-printers.conf"
BeginGroupIfFileExists "/etc/local-COMMON/samba/smb-shares-$(site).conf"
AppendIfNoSuchLine "include = /etc/samba/smb-shares-$(site).conf"
EndGroup
@@ -137,19 +120,19 @@ editfiles:
EndGroup
#
- # logon drive = U:
+ # logon drive = Z:
#
LocateLineMatching "^[;[:blank:]]*logon drive[[:blank:]]*=.*"
- BeginGroupIfNoLineMatching "^[[:blank:]]*logon drive[[:blank:]]*=[[:blank:]]*U:[[:blank:]]*"
- ReplaceLineWith ' logon drive = U:'
+ BeginGroupIfNoLineMatching "^[[:blank:]]*logon drive[[:blank:]]*=[[:blank:]]*Z:[[:blank:]]*"
+ ReplaceLineWith ' logon drive = Z:'
EndGroup
CatchAbort
- BeginGroupIfNoMatch "^[[:blank:]]*logon drive[[:blank:]]*=[[:blank:]]*U:[[:blank:]]*"
- InsertLine ' logon drive = U:'
+ BeginGroupIfNoMatch "^[[:blank:]]*logon drive[[:blank:]]*=[[:blank:]]*Z:[[:blank:]]*"
+ InsertLine ' logon drive = Z:'
EndGroup
#
- # logon script = common.bat
+ # logon script = logon-$(site).bat
#
LocateLineMatching "^[;[:blank:]]*logon script[[:blank:]]*=.*"
BeginGroupIfNoLineMatching "^[[:blank:]]*logon script[[:blank:]]*=[[:blank:]]*logon-$(site).bat[[:blank:]]*"
@@ -173,15 +156,15 @@ editfiles:
EndGroup
#
- # logon path = \\%N\USERPROFILES\%U
+ # logon home = \\%N\USERPROFILES\%U
#
- LocateLineMatching "^[;[:blank:]]*logon path[[:blank:]]*=.*"
- BeginGroupIfNoLineMatching "^[[:blank:]]*logon path[[:blank:]]*=[[:blank:]]*[\\][\\]%N[\\]USERPROFILES[\\]%U[[:blank:]]*"
- ReplaceLineWith ' logon path = \\%N\USERPROFILES\%U'
+ LocateLineMatching "^[;[:blank:]]*logon home[[:blank:]]*=.*"
+ BeginGroupIfNoLineMatching "^[[:blank:]]*logon home[[:blank:]]*=[[:blank:]]*[\\][\\]%N[\\]USERPROFILES[\\]%U[[:blank:]]*"
+ ReplaceLineWith ' logon home = \\%N\USERPROFILES\%U'
EndGroup
CatchAbort
- BeginGroupIfNoMatch "^[[:blank:]]*logon path[[:blank:]]*=[[:blank:]]*[\\][\\]%N[\\]USERPROFILES[\\]%U[[:blank:]]*"
- InsertLine ' logon path = \\%N\USERPROFILES\%U'
+ BeginGroupIfNoMatch "^[[:blank:]]*logon home[[:blank:]]*=[[:blank:]]*[\\][\\]%N[\\]USERPROFILES[\\]%U[[:blank:]]*"
+ InsertLine ' logon home = \\%N\USERPROFILES\%U'
EndGroup
#
@@ -198,31 +181,6 @@ editfiles:
DefineClasses "samba_reload"
}
- { /etc/samba/smb-printers.conf
- #
- # This file contains all the printers defined in the Linux printing
- # system. There shouldn't be any need for setting up additional
- # printer entries. Manage the printers through the Linux print
- # system you have installed - cups or lprng.
- # We check if the proper sections are there and add them if they
- # isn't. We don't check the file line for line.
- #
- AutoCreate
-
- #
- # [printers]
- #
- BeginGroupIfNoLineMatching "^\[printers\]"
- Append '[printers]'
- Append ' comment = %S printer'
- Append ' path = $(printdir)'
- Append ' print command = /usr/bin/lpr -h %s'
- Append ' lprm command = /usr/bin/lprm -P%S %j'
- Append ' public = yes'
- Append ' printable = yes'
- EndGroup
- }
-
#
# Batch file for mounting shares automatically
#
@@ -283,33 +241,6 @@ editfiles:
EndGroup
}
- { /etc/samba/smb-shares-COMMON.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
- }
-
- { /etc/samba/smb-shares-$(site).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
- }
-
- { /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
- }
-
processes:
"smbd" restart "/etc/init.d/samba restart"
"afpd" restart "/etc/init.d/netatalk restart"