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