summaryrefslogtreecommitdiff
path: root/samba/smb-shares-divitech.conf
blob: bbf84a2e48709370cba129b9ba230ef5e064ee57 (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. netlogshare = ( /etc/samba/netlogon )
  13. commonsharedir = ( /home/fsadmin/COMMON )
  14. datashare = ( /home/fsadmin/COMMON/documents )
  15. softshare = ( /home/fsadmin/COMMON/software )
  16. adminshare = ( /home/fsadmin/COMMON/admin )
  17. profshare = ( /home/fsadmin/COMMON/samba/userprofiles )
  18. privpcshare = ( .pcshare )
  19. #
  20. # Administrative user and group
  21. #
  22. adminuser = ( fsadmin )
  23. admingrp = ( fsadmin )
  24. editfiles:
  25. samba::
  26. { /etc/samba/smb-shares-$(site).conf
  27. #
  28. # This file contains the shares common to a site.
  29. # We check if the proper sections are there and add them if they
  30. # isn't. We don't check the file line for line.
  31. #
  32. AutoCreate
  33. #
  34. # [netlogon]
  35. #
  36. BeginGroupIfNoLineMatching "^\[netlogon\]"
  37. Append '[netlogon]'
  38. Append ' comment = Network logon'
  39. Append ' path = $(netlogshare)'
  40. Append ' browsable = no'
  41. Append ' writeable = no'
  42. Append ' share modes = no'
  43. EndGroup
  44. #
  45. # [userprofiles]
  46. #
  47. BeginGroupIfNoLineMatching "^\[userprofiles\]"
  48. Append '[userprofiles]'
  49. Append ' path = $(profshare)'
  50. Append ' force user = %u'
  51. Append ' browsable = yes'
  52. Append ' writable = yes'
  53. EndGroup
  54. #
  55. # [homes]
  56. #
  57. BeginGroupIfNoLineMatching "^\[homes\]"
  58. Append '[homes]'
  59. Append ' path = /home/%u/$(privpcshare)'
  60. Append ' browsable = no'
  61. Append ' writable = yes'
  62. EndGroup
  63. #
  64. # [programmer]
  65. #
  66. BeginGroupIfNoLineMatching "^\[software\]"
  67. Append '[software]'
  68. Append ' path = $(softshare)'
  69. Append ' comment = Fælles software'
  70. Append ' browsable = yes'
  71. Append ' guest ok = no'
  72. Append ' writeable = yes'
  73. Append ' create mask = 0660'
  74. Append ' directory mask = 0770'
  75. Append ' valid users = @$(admingrp)'
  76. Append ' force group = +$(admingrp)'
  77. EndGroup
  78. #
  79. # [dokumenter]
  80. #
  81. BeginGroupIfNoLineMatching "^\[dokumenter\]"
  82. Append '[dokumenter]'
  83. Append ' path = $(datashare)'
  84. Append ' comment = Fælles drev for delte filer'
  85. Append ' browsable = yes'
  86. Append ' guest ok = no'
  87. Append ' writeable = yes'
  88. Append ' create mask = 0660'
  89. Append ' directory mask = 0770'
  90. Append ' valid users = @$(admingrp)'
  91. Append ' force group = +$(admingrp)'
  92. EndGroup
  93. #
  94. # [dokumenter]
  95. #
  96. BeginGroupIfNoLineMatching "^\[admin\]"
  97. Append '[admin]'
  98. Append ' path = $(adminshare)'
  99. Append ' comment = Dokumentation og adminværktøjer'
  100. Append ' browsable = yes'
  101. Append ' guest ok = yes'
  102. Append ' writeable = no'
  103. Append ' valid users = @$(admingrp)'
  104. Append ' force group = +$(admingrp)'
  105. EndGroup
  106. DefineClasses "samba_reload"
  107. }
  108. samba_reload::
  109. { /etc/samba/smb-shares-$(site).conf
  110. LocateLineMatching "^; EDITED BY CFENGINE .*"
  111. ReplaceAll '; EDITED BY CFENGINE .*$' With '; EDITED BY CFENGINE $(date)'
  112. CatchAbort
  113. BeginGroupIfNoMatch "^; EDITED BY CFENGINE .*"
  114. Append '; EDITED BY CFENGINE $(date)'
  115. EndGroup
  116. }
  117. directories:
  118. any::
  119. $(commonsharedir)
  120. mode=755
  121. owner=$(adminuser)
  122. group=$(admingrp)
  123. $(softshare)
  124. mode=775
  125. owner=$(adminuser)
  126. group=$(admingrp)
  127. $(datashare)
  128. mode=775
  129. owner=$(adminuser)
  130. group=$(admingrp)
  131. samba::
  132. $(netlogshare)
  133. mode=755
  134. owner=root
  135. group=root
  136. $(profshare)
  137. mode=775
  138. owner=$(adminuser)
  139. group=$(admingrp)
  140. $(adminshare)
  141. mode=755
  142. owner=$(adminuser)
  143. group=$(admingrp)
  144. processes:
  145. "smbd" restart "/etc/init.d/samba restart"
  146. shellcommands:
  147. samba_reload::
  148. "/etc/init.d/samba force-reload"