summaryrefslogtreecommitdiff
path: root/cfengine/cf.services.file
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2002-06-13 09:58:58 +0000
committerJonas Smedegaard <dr@jones.dk>2002-06-13 09:58:58 +0000
commit6435466da42781d164753fb42877b24831162027 (patch)
treeaed9638bf7814f49f253c10567bab91a90748882 /cfengine/cf.services.file
parent899d2b4a4bbd24e3c301538718899232dbfa38b4 (diff)
* Added artax.lab.dk (replaces artax.jones.dk)
* Updates to cf.services.file * Changes in cf.services.file: Use fqhost instead of site some places!!!
Diffstat (limited to 'cfengine/cf.services.file')
-rw-r--r--cfengine/cf.services.file54
1 files changed, 27 insertions, 27 deletions
diff --git a/cfengine/cf.services.file b/cfengine/cf.services.file
index d3b6e21..bf7ae59 100644
--- a/cfengine/cf.services.file
+++ b/cfengine/cf.services.file
@@ -1,6 +1,6 @@
control:
- AddInstallable = ( samba samba_reload samba_rebuild_shares netatalk netatalk_reload netatalk_rebuild_shares lprng lprng_reload cups cups_reload )
-
+ AddInstallable = ( samba samba_reload netatalk netatalk_reload lprng lprng_reload cups cups_reload )
+
classes:
#
# Determine if this is a samba server, netatalk server or both, and define
@@ -8,14 +8,14 @@ classes:
#
samba = ( `/usr/bin/test -x /usr/sbin/smbd` )
netatalk = ( `/usr/bin/test -x /usr/sbin/afpd` )
-
+
#
# Determine which print system is in use, and define classes based on that.
# We only support lprng and cups
#
lprng = ( `/usr/bin/test -x /usr/sbin/lpd` )
cups = ( `/usr/bin/test -x /usr/sbin/cupsd` )
-
+
editfiles:
samba.lprng::
{ /etc/samba/smb.conf
@@ -25,7 +25,7 @@ editfiles:
{ /etc/samba/smb.conf
AppendIfNoSuchLine "include = /etc/samba/smb-printers-cups.conf"
}
-
+
samba::
{ /etc/samba/smb.conf
#
@@ -108,15 +108,15 @@ editfiles:
InsertLine ' logon drive = Z:'
EndGroup
#
- # logon script = logon-$(site).bat
+ # logon script = logon-$(fqhost).bat
#
LocateLineMatching "^[;[:blank:]]*logon script[[:blank:]]*=.*"
- BeginGroupIfNoLineMatching "^[[:blank:]]*logon script[[:blank:]]*=[[:blank:]]*logon-$(site).bat[[:blank:]]*"
- ReplaceLineWith ' logon script = logon-$(site).bat'
+ BeginGroupIfNoLineMatching "^[[:blank:]]*logon script[[:blank:]]*=[[:blank:]]*logon-$(fqhost).bat[[:blank:]]*"
+ ReplaceLineWith ' logon script = logon-$(fqhost).bat'
EndGroup
CatchAbort
- BeginGroupIfNoMatch "^[[:blank:]]*logon script[[:blank:]]*=[[:blank:]]*logon-$(site).bat[[:blank:]]*"
- InsertLine ' logon script = logon-$(site).bat'
+ BeginGroupIfNoMatch "^[[:blank:]]*logon script[[:blank:]]*=[[:blank:]]*logon-$(fqhost).bat[[:blank:]]*"
+ InsertLine ' logon script = logon-$(fqhost).bat'
EndGroup
#
# domain logons = yes
@@ -184,30 +184,33 @@ editfiles:
#
# Batch file for mounting shares automatically
#
- { /etc/samba/netlogon/logon-$(site).bat
+ { /etc/samba/netlogon/logon-$(fqhost).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/logon-$(site).bat"
- AutoCreate
+ AutoCreate
+ BeginGroupIfFileIsNewer "/etc/local-COMMON/samba/netlogon/logon-$(fqhost).bat"
EmptyEntireFilePlease
- InsertFile "/etc/local-COMMON/samba/netlogon/logon-$(site).bat"
- Append "rem Edited by cfengine $(date)"
- FixEndOfLine "dos"
+ SetLine "rem DO NOT EDIT - auto-created by cfengine $(date)"
+ PrependIfNoLineMatching "^rem .* cfengine .*"
+ InsertFile "/etc/local-COMMON/samba/netlogon/logon-$(fqhost).bat"
EndGroup
- DefineClasses "samba_reload"
+ FixEndOfLine "dos"
}
#
# Check if the shares definitions have changed
#
{ /etc/samba/smb-shares.conf
- SetScript "m4 -DFQDN=$(fqhost) /etc/local-COMMON/samba/smb-shares.conf.m4 > /etc/samba/smb-shares.conf"
+ AutoCreate
BeginGroupIfFileIsNewer "/etc/local-COMMON/file-$(fqhost).m4"
- RunScript
+ EmptyEntireFilePlease
+ SetLine "# DO NOT EDIT - auto-created by cfengine $(date)"
+ PrependIfNoLineMatching "^# .* cfengine .*"
+# RunScript "/usr/bin/m4 -DFQDN=$(fqhost) /etc/local-COMMON/samba/smb-shares.conf.m4 >> /etc/samba/smb-shares.conf"
EndGroup
- DefineClasses "samba_rebuild_shares:samba_reload"
+ DefineClasses "samba_reload"
}
lprng::
@@ -219,10 +222,11 @@ editfiles:
# We don't make the printcap 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/printcap.$(site)"
+ BeginGroupIfFileIsNewer "/etc/local-COMMON/printcap.$(fqhost)"
+ SetLine "# DO NOT EDIT - auto-created by cfengine $(date)"
+ PrependIfNoLineMatching "^# .* cfengine .*"
EmptyEntireFilePlease
- InsertFile "/etc/local-COMMON/printcap.$(site)"
- Append "# Edited by cfengine $(date)"
+ InsertFile "/etc/local-COMMON/printcap.$(fqhost)"
EndGroup
DefineClasses "lprng_reload"
}
@@ -241,10 +245,6 @@ processes:
"smbd" restart "/etc/init.d/samba restart"
"afpd" restart "/etc/init.d/netatalk restart"
-shellcommands.shares:
- samba_rebuild_shares::
- "m4 -DFQDN=$(fqhost) /etc/local-COMMON/samba/smb-shares.conf.m4 > /etc/samba/smb-shares.conf"
-
shellcommands:
samba_reload::
"/etc/init.d/samba force-reload"