summaryrefslogtreecommitdiff
path: root/cfengine/cf.services.file
diff options
context:
space:
mode:
authorJuri Jensen <juri@xenux.dk>2002-01-09 22:41:29 +0000
committerJuri Jensen <juri@xenux.dk>2002-01-09 22:41:29 +0000
commitd2035a2e64eba9e38e53f9b2930fc8e7150c102e (patch)
treefd48b49b38163683fbca74d1e39a58c77ee3f084 /cfengine/cf.services.file
parent89f7f78402a0f4362f59ffd693b8491b34700abe (diff)
cfengine: Major changes in the way samba is handled - now all shares are
individual for every site (see cf.services.file and local-COMMON/samba/smb-shares-raatstof.conf as an example). Bind's named.conf is now edited to include named_$(host).$(domain).conf - nothing more. The DNSServers part is also turned on again. A new section for DHCPServers are now included and turned on - it only switches /etc/init.d/dhcp on and copies the right dhcpd.conf file into /etc, nothing more. I've also added a new site to cf.site.xenux and cf.groups.xenux. Well, that's it for now...
Diffstat (limited to 'cfengine/cf.services.file')
-rw-r--r--cfengine/cf.services.file162
1 files changed, 24 insertions, 138 deletions
diff --git a/cfengine/cf.services.file b/cfengine/cf.services.file
index 47bec59..b2ccab2 100644
--- a/cfengine/cf.services.file
+++ b/cfengine/cf.services.file
@@ -1,8 +1,8 @@
control:
AddInstallable = ( samba samba_reload netatalk netatalk_reload lprng lprng_reload cups cups_reload )
- #
- # Variables for shares
+# #
+# # 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
@@ -10,21 +10,21 @@ control:
# 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 )
+# 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 )
+# privpcshare = ( .pcshare )
+# privmacshare = ( .macshare )
+# privxchngshare = ( .xchangeshare )
#
# Administrative user and group
#
- adminuser = ( fsadmin )
- admingrp = ( fsadmin )
+# adminuser = ( fsadmin )
+# admingrp = ( fsadmin )
#
# Determine if this is a samba server, netatalk server or both, and define
@@ -40,6 +40,10 @@ classes:
#
lprng = ( `/usr/bin/test -x /usr/sbin/lpd` )
cups = ( `/usr/bin/test -x /usr/sbin/cupsd` )
+
+import:
+ samba::
+ /etc/local-COMMON/samba/smb-shares-$(site).conf
editfiles:
samba::
@@ -65,7 +69,7 @@ editfiles:
#
# Append the include lines for the files decribed above
#
- AppendIfNoSuchLine "include = /etc/samba/smb-shares-COMMON.conf"
+# 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"
@@ -148,12 +152,12 @@ editfiles:
# logon script = common.bat
#
LocateLineMatching "^[;[:blank:]]*logon script[[:blank:]]*=.*"
- BeginGroupIfNoLineMatching "^[[:blank:]]*logon script[[:blank:]]*=[[:blank:]]*common.bat[[:blank:]]*"
- ReplaceLineWith ' logon script = common.bat'
+ BeginGroupIfNoLineMatching "^[[:blank:]]*logon script[[:blank:]]*=[[:blank:]]*logon-$(site).bat[[:blank:]]*"
+ ReplaceLineWith ' logon script = logon-$(site).bat'
EndGroup
CatchAbort
- BeginGroupIfNoMatch "^[[:blank:]]*logon script[[:blank:]]*=[[:blank:]]*common.bat[[:blank:]]*"
- InsertLine ' logon script = common.bat'
+ BeginGroupIfNoMatch "^[[:blank:]]*logon script[[:blank:]]*=[[:blank:]]*logon-$(site).bat[[:blank:]]*"
+ InsertLine ' logon script = logon-$(site).bat'
EndGroup
#
@@ -194,96 +198,6 @@ editfiles:
DefineClasses "samba_reload"
}
- { /etc/samba/smb-shares-COMMON.conf
- #
- # This file contains all the shares common to all installations.
- # 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
-
- #
- # [netlogon]
- #
- BeginGroupIfNoLineMatching "^\[netlogon\]"
- Append '[netlogon]'
- Append ' comment = Network logon'
- Append ' path = $(netlogshare)'
- Append ' browsable = no'
- Append ' writeable = no'
- Append ' share modes = no'
- EndGroup
- #
- # [userprofiles]
- #
- BeginGroupIfNoLineMatching "^\[userprofiles\]"
- Append '[userprofiles]'
- Append ' path = $(profshare)'
- Append ' force user = %u'
- Append ' writable = yes'
- Append ' browsable = no'
- Append ' root preexec = /bin/mkdir $(profshare)/%U \'
- Append ' /bin/chown %U $(profshare)/%U \'
- Append ' /bin/chmod 700 $(profshare)/%U'
- EndGroup
- #
- # [homes]
- #
- BeginGroupIfNoLineMatching "^\[homes\]"
- Append '[homes]'
- Append ' path = /home/%u/$(privpcshare)'
- Append ' browsable = no'
- Append ' root preexec = /bin/mkdir /home/%u/$(privpcshare) \'
- Append ' /bin/chown %U /home/%u/$(privpcshare) \'
- Append ' /bin/chmod 644 /home/%u/$(privpcshare)'
- EndGroup
- #
- # [programmer]
- #
- BeginGroupIfNoLineMatching "^\[software\]"
- Append '[software]'
- Append ' path = $(softshare)'
- Append ' comment = Fælles software'
- Append ' browsable = yes'
- Append ' guest ok = no'
- Append ' writeable = yes'
- Append ' valid users = @$(admingrp)'
- Append ' force group = +$(admingrp)'
- EndGroup
- #
- # [dokumenter]
- #
- BeginGroupIfNoLineMatching "^\[dokumenter\]"
- Append '[dokumenter]'
- Append ' path = $(datashare)'
- Append ' comment = Fælles dokumenter'
- Append ' browsable = yes'
- Append ' guest ok = no'
- Append ' writeable = yes'
- Append ' valid users = @$(admingrp)'
- Append ' force group = +$(admingrp)'
- EndGroup
- DefineClasses "samba_reload"
- }
-
- #
- # Local shares special for the site.
- # In this file you can define special shares that you need
- #
- { /etc/samba/smb-shares-$(site).conf
- #
- # We don't make this file dynamically, but instead we copy the contents
- # of a master file, but only if it's newer than the one installed.
- #
- AutoCreate
- BeginGroupIfFileIsNewer "/etc/local-COMMON/samba/smb-shares-$(site).conf"
- EmptyEntireFilePlease
- InsertFile "/etc/local-COMMON/samba/smb-shares-$(site).conf"
- Append "; Edited by cfengine $(date)"
- EndGroup
- DefineClasses "samba_reload"
- }
-
{ /etc/samba/smb-printers.conf
#
# This file contains all the printers defined in the Linux printing
@@ -312,15 +226,15 @@ editfiles:
#
# Batch file for mounting shares automatically
#
- { /etc/samba/netlogon/common.bat
+ { /etc/samba/netlogon/logon-$(site).bat
#
# We don't make this file dynamically, but instead we copy the contents
# of a master file, but only if it's newer than the one installed.
#
- BeginGroupIfFileIsNewer "/etc/local-COMMON/samba/netlogon/common.bat"
+ BeginGroupIfFileIsNewer "/etc/local-COMMON/samba/netlogon/logon-$(site).bat"
AutoCreate
EmptyEntireFilePlease
- InsertFile "/etc/local-COMMON/samba/netlogon/common.bat"
+ InsertFile "/etc/local-COMMON/samba/netlogon/logon-$(site).bat"
Append "rem Edited by cfengine $(date)"
EndGroup
DefineClasses "samba_reload"
@@ -396,34 +310,6 @@ editfiles:
EndGroup
}
-directories:
- any::
- $(commonsharedir)
- mode=755
- owner=$(adminuser)
- group=$(admingrp)
- $(softshare)
- mode=775
- owner=$(adminuser)
- group=$(admingrp)
- $(datashare)
- mode=775
- owner=$(adminuser)
- group=$(admingrp)
- samba::
- $(netlogshare)
- mode=755
- owner=root
- group=root
- $(profshare)
- mode=775
- owner=$(adminuser)
- group=$(admingrp)
- $(printdir)
- mode=775
- owner=root
- group=root
-
processes:
"smbd" restart "/etc/init.d/samba restart"
"afpd" restart "/etc/init.d/netatalk restart"