summaryrefslogtreecommitdiff
path: root/samba/smb-shares-cafe3.conf
blob: 0a29d30cf5a30bc38fdbfc9f26a0db536dbda7c7 (plain)
  1. control:
  2.     AddInstallable = ( samba samba_reload )
  3. #
  4. # Variables for shares
  5. # You can change the paths here and it will be changed both in
  6. # the conf file and in the filesystem - But once it is implemented,
  7. # it is not wise to change it - the data in the shares doesn't get
  8. # moved!
  9. # You can change the rights on the shares in the "directories:"
  10. # section.
  11. #
  12. pcprvdir = ( "/home/%u" )
  13. commonsharedir = ( /home/fsadmin )
  14. profilshare = ( /home/fsadmin/pc_userprofiles )
  15. xchngshare = ( /home/fsadmin/pc_xchange )
  16. netlog = ( "netlogon" )
  17. netlogtxt = ( "Network logon" )
  18. netlogshare = ( /etc/samba/netlogon )
  19. privpctxt = ( "Pers. PC Documents" )
  20. privpcshare = ( pc )
  21. privmac = ( "pers_mac" )
  22. privmactxt = ( "Pers. Mac Documents" )
  23. privmacshare = ( mac )
  24. privwww = ( "pers_www" )
  25. privwwwtxt = ( "Pers. Web Documents" )
  26. privwwwshare = ( public_html )
  27. privxchng = ( "pers_shared" )
  28. privxchngtxt = ( "Pers. Shared Documents" )
  29. privxchngshare = ( xchange )
  30. data = ( "docs" )
  31. datatxt = ( "Shared Documents" )
  32. datashare = ( /home/fsadmin/pc_doc )
  33. soft = ( "software" )
  34. softtxt = ( "Shared Software" )
  35. softshare = ( /home/fsadmin/pc_software )
  36. admin = ( "admin" )
  37. admintxt = ( "Documentation and Admin Tools" )
  38. adminshare = ( /home/fsadmin/pc_admin )
  39. #
  40. # Shared group
  41. #
  42. sharedgrp = ( users )
  43. #
  44. # Administrative user and group
  45. #
  46. adminuser = ( fsadmin )
  47. admingrp = ( fsadmin )
  48. #
  49. # Misc common strings
  50. #
  51. pcvetofiles = ( "/.AppleDouble/.AppleDesktop/Network Trash Folder/DesktopFolderDB/resource.frk/Icon^M/TheVolumeSettingsFolder/" )
  52. editfiles:
  53. samba::
  54. { /etc/samba/smb-shares-$(site).conf
  55. #
  56. # This file contains the shares common to a site.
  57. # We check if the proper sections are there and add them if they
  58. # isn't. We don't check the file line for line.
  59. #
  60. AutoCreate
  61. #
  62. # [$(netlog)]
  63. #
  64. BeginGroupIfNoLineMatching "^\[$(netlog)\]"
  65. Append '[$(netlog)]'
  66. Append ' comment = $(netlogtxt)'
  67. Append ' path = $(netlogshare)'
  68. Append ' browsable = no'
  69. Append ' writeable = no'
  70. Append ' share modes = no'
  71. EndGroup
  72. #
  73. # [userprofiles]
  74. #
  75. BeginGroupIfNoLineMatching "^\[userprofiles\]"
  76. Append '[userprofiles]'
  77. Append ' path = $(profilshare)'
  78. Append ' force user = %u'
  79. Append ' browsable = yes'
  80. Append ' writable = yes'
  81. Append ' root preexec = /bin/mkdir $(profilshare)/%U \'
  82. Append ' /bin/chown %U: $(profilshare)/%U \'
  83. Append ' /bin/chmod 700 $(profilshare)/%U'
  84. EndGroup
  85. #
  86. # [homes]
  87. #
  88. BeginGroupIfNoLineMatching "^\[homes\]"
  89. Append '[homes]'
  90. Append ' comment = $(privpctxt)'
  91. Append ' path = $(pcprvdir)/$(privpcshare)'
  92. Append ' browsable = no'
  93. Append ' writable = yes'
  94. Append ' root preexec = /bin/mkdir $(pcprvdir)/$(privpcshare) \'
  95. Append ' /bin/chown %U: $(pcprvdir)/$(privpcshare) \'
  96. Append ' /bin/chmod 640 $(pcprvdir)/$(privpcshare)'
  97. EndGroup
  98. #
  99. # [$(privmac)]
  100. #
  101. BeginGroupIfNoLineMatching "^\[$(privmac)\]"
  102. Append '[$(privmac)]'
  103. Append ' comment = $(privmactxt)'
  104. Append ' path = $(pcprvdir)/$(privmacshare)'
  105. Append ' browsable = no'
  106. Append ' writable = no'
  107. EndGroup
  108. #
  109. # [$(privweb)]
  110. #
  111. BeginGroupIfNoLineMatching "^\[$(privwww)\]"
  112. Append '[$(privwww)]'
  113. Append ' comment = $(privwwwtxt)'
  114. Append ' path = $(pcprvdir)/$(privwwwshare)'
  115. Append ' browsable = no'
  116. Append ' writable = yes'
  117. Append ' root preexec = /bin/mkdir $(pcprvdir)/$(privwwwshare) \'
  118. Append ' /bin/chown %U: $(pcprvdir)/$(privwwwshare) \'
  119. Append ' /bin/chmod 644 $(pcprvdir)/$(privwwwshare)'
  120. EndGroup
  121. #
  122. # [$(privxchng)]
  123. #
  124. BeginGroupIfNoLineMatching "^\[$(privxchng)\]"
  125. Append '[$(privxchng)]'
  126. Append ' comment = $(privxchngtxt)'
  127. Append ' path = $(pcprvdir)/$(privxchngshare)'
  128. Append ' browsable = no'
  129. Append ' writable = yes'
  130. Append ' valid users = @$(sharedgrp)'
  131. Append ' force group = +$(sharedgrp)'
  132. Append ' root preexec = /bin/mkdir $(pcprvdir)/$(privpcshare) \'
  133. Append ' /bin/chown %U:$(sharedgrp) $(pcprvdir)/$(privpcshare) \'
  134. Append ' /bin/chmod 644 $(pcprvdir)/$(privpcshare) \'
  135. Append ' /bin/rm -f $(xchngshare) \'
  136. Append ' /bin/ln -dfs $(pcprvdir)/$(privxchngshare) $(xchngshare)'
  137. EndGroup
  138. #
  139. # [$(data)]
  140. #
  141. BeginGroupIfNoLineMatching "^\[$(data)\]"
  142. Append '[$(data)]'
  143. Append ' comment = $(datatxt)'
  144. Append ' path = $(datashare)'
  145. Append ' browsable = yes'
  146. Append ' guest ok = no'
  147. Append ' writeable = yes'
  148. Append ' create mask = 0660'
  149. Append ' directory mask = 0770'
  150. Append ' valid users = @$(admingrp)'
  151. Append ' force group = +$(admingrp)'
  152. Append ' delete veto files = Yes'
  153. Append ' veto files = $(pcvetofiles)'
  154. EndGroup
  155. #
  156. # [$(soft)]
  157. #
  158. BeginGroupIfNoLineMatching "^\[$(soft)\]"
  159. Append '[$(soft)]'
  160. Append ' comment = $(softtxt)'
  161. Append ' path = $(softshare)'
  162. Append ' browsable = yes'
  163. Append ' guest ok = no'
  164. Append ' writeable = yes'
  165. Append ' create mask = 0660'
  166. Append ' directory mask = 0770'
  167. Append ' valid users = @$(admingrp)'
  168. Append ' force group = +$(admingrp)'
  169. Append ' delete veto files = Yes'
  170. Append ' veto files = $(pcvetofiles)'
  171. EndGroup
  172. #
  173. # [$(admin)]
  174. #
  175. BeginGroupIfNoLineMatching "^\[$(admin)\]"
  176. Append '[$(admin)]'
  177. Append ' comment = $(admintxt)'
  178. Append ' path = $(adminshare)'
  179. Append ' browsable = yes'
  180. Append ' guest ok = yes'
  181. Append ' writeable = no'
  182. Append ' valid users = @$(admingrp)'
  183. Append ' force group = +$(admingrp)'
  184. EndGroup
  185. DefineClasses "samba_reload"
  186. }
  187. samba_reload::
  188. { /etc/samba/smb-shares-$(site).conf
  189. LocateLineMatching "^; EDITED BY CFENGINE .*"
  190. ReplaceAll '; EDITED BY CFENGINE .*$' With '; EDITED BY CFENGINE $(date)'
  191. CatchAbort
  192. BeginGroupIfNoMatch "^; EDITED BY CFENGINE .*"
  193. Append '; EDITED BY CFENGINE $(date)'
  194. EndGroup
  195. }
  196. directories:
  197. any::
  198. $(commonsharedir)
  199. mode=755
  200. owner=$(adminuser)
  201. group=$(admingrp)
  202. $(softshare)
  203. mode=775
  204. owner=$(adminuser)
  205. group=$(admingrp)
  206. $(datashare)
  207. mode=775
  208. owner=$(adminuser)
  209. group=$(admingrp)
  210. samba::
  211. $(netlogshare)
  212. mode=755
  213. owner=root
  214. group=root
  215. $(xchngshare)
  216. mode=755
  217. owner=root
  218. group=root
  219. $(profilshare)
  220. mode=775
  221. owner=$(adminuser)
  222. group=$(admingrp)
  223. $(adminshare)
  224. mode=755
  225. owner=$(adminuser)
  226. group=$(admingrp)
  227. processes:
  228. "smbd" restart "/etc/init.d/samba restart"
  229. shellcommands:
  230. samba_reload::
  231. "/etc/init.d/samba force-reload"