59 lines
1.4 KiB
Text
59 lines
1.4 KiB
Text
[global]
|
|
|
|
# host naming
|
|
<% if @auth == 'ad' -%>
|
|
workgroup = <%= @workgroup.split('.')[0].upcase %>
|
|
<% else -%>
|
|
workgroup = <%= @workgroup.upcase %>
|
|
<% end -%>
|
|
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,cn=config,<%= @ldap_basedn %>
|
|
ldap ssl = no
|
|
ldap suffix = <%= @ldap_basedn %>
|
|
<% elsif @auth == 'domain' -%>
|
|
security = domain
|
|
password server = *
|
|
<% elsif @auth == 'ad' -%>
|
|
security = ADS
|
|
realm = <%= @workgroup.upcase %>
|
|
kerberos method = secrets and keytab
|
|
<% else -%>
|
|
<% scope.function_fail(['Invalid value "%s" for auth.' % @auth]) -%>
|
|
<% end -%>
|
|
lanman auth = no
|
|
ntlm auth = no
|
|
|
|
# log per machine and rotate after 128MB
|
|
log file = /var/log/samba/%m.log
|
|
max log size = 131072
|
|
|
|
unix charset = <%= @charset %>
|
|
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
|
|
<% if @localconf -%>
|
|
include = /etc/samba/smb.conf.d/local.conf
|
|
<% end -%>
|
|
|
|
include = /etc/samba/smb.conf.d/shares.conf
|