samba: Refactored samba module to use templates.

This commit is contained in:
Timo Mkinen 2013-06-14 12:25:45 +03:00
parent 734fbfdace
commit 5309521c18
6 changed files with 430 additions and 123 deletions

View file

@ -0,0 +1,11 @@
os level = 130
domain master = no
domain logons = yes
time server = yes
logon script = logon.bat
logon drive = p:
logon path = \\%L\profiles\%U
logon home = \\%L\%U

View file

@ -0,0 +1,12 @@
os level = 140
domain master = yes
preferred master = yes
domain logons = yes
time server = yes
logon script = logon.bat
logon drive = p:
logon path = \\%L\profiles\%U
logon home = \\%L\%U

View file

@ -0,0 +1,13 @@
[<%= @name %>]
comment = <% if @comment %><%= @comment %><% else %><%= @name %><% end %>
path = <%= @path %>
inherit permissions = yes
invalid users = root
<% if @readonly -%>
read only = yes
<% else -%>
read only = no
<% end -%>
<% @options.each do |option| -%>
<%= option %>
<% end -%>

View file

@ -0,0 +1,47 @@
[global]
# host naming
workgroup = <%= @workgroup %>
server string = <%= @description %>
netbios name = <%= @names[0] %>
<% if @names.length > 1 -%>
netbios aliases = <%= @names.drop(1).join(' ') %>
<% end -%>
<% if @interfaces -%>
interfaces = lo <%= @interfaces.join(' ') %>
bind interfaces only = true
<% end -%>
# authentication
<% if @auth == 'tdbsam' -%>
security = user
passdb backend = tdbsam
<% elsif @auth == 'ldap' -%>
security = user
passdb backend = ldapsam:"<%= @ldap_server.join(' ') -%>"
ldap passwd sync = Only
ldap admin dn = "uid=smbadmin,ou=System,<%= @ldap_basedn %>
ldap ssl = no
ldap suffix = <%= @ldap_basedn %>
<% elsif @auth == 'domain' -%>
security = domain
password server = *
<% else -%>
<% scope.function_fail(['Invalid value "%s" for auth.' % @auth]) -%>
<% end -%>
# log per machine and rotate after 128MB
log file = /var/log/samba/%m.log
max log size = 131072
unix charset = iso-8859-1
unix extensions = no
wide links = no
include = /etc/samba/smb.conf.d/domain.conf
include = /etc/samba/smb.conf.d/print.conf
include = /etc/samba/smb.conf.d/wins.conf
include = /etc/samba/smb.conf.d/shares.conf