2015-03-13 20:55:33 +00:00
|
|
|
# Samba configuration -- Managed by Ansible, please don't edit manually
|
|
|
|
# vim: ft=samba
|
|
|
|
#
|
|
|
|
# {{ ansible_managed }}
|
|
|
|
|
|
|
|
[global]
|
|
|
|
# Server information
|
2015-11-05 14:14:12 +00:00
|
|
|
netbios name = {% if samba_netbios_name is defined %}{{ samba_netbios_name }}{% else %}{{ ansible_hostname }}{% endif %}
|
|
|
|
|
2015-03-13 20:55:33 +00:00
|
|
|
workgroup = {{ samba_workgroup }}
|
2017-11-05 11:57:31 +00:00
|
|
|
{% if samba_realm is defined %}
|
|
|
|
realm = {{ samba_realm }}
|
|
|
|
{% endif %}
|
2018-05-19 22:48:15 +00:00
|
|
|
server string = {{ samba_server_string }}
|
2015-03-13 20:55:33 +00:00
|
|
|
|
2018-09-03 05:23:50 +00:00
|
|
|
{% if samba_apple_extensions is defined %}
|
|
|
|
fruit:aapl = yes
|
|
|
|
{% endif %}
|
|
|
|
|
2015-03-13 20:55:33 +00:00
|
|
|
# Logging
|
|
|
|
{% if samba_log is defined %}
|
|
|
|
log file = {{ samba_log }}
|
|
|
|
max log size = {{ samba_log_size }}
|
|
|
|
{% else %}
|
2018-08-16 18:54:02 +00:00
|
|
|
logging = syslog
|
2015-03-13 20:55:33 +00:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
# Authentication
|
|
|
|
security = {{ samba_security }}
|
|
|
|
passdb backend = {{ samba_passdb_backend }}
|
|
|
|
map to guest = {{ samba_map_to_guest }}
|
2017-03-10 18:06:10 +00:00
|
|
|
{% if samba_guest_account is defined %}
|
2017-03-10 17:55:02 +00:00
|
|
|
guest account = {{ samba_guest_account }}
|
2017-03-10 18:06:10 +00:00
|
|
|
{% endif %}
|
2017-12-28 07:40:28 +00:00
|
|
|
{% if samba_username_map is defined %}
|
|
|
|
username map = {{ samba_username_map_file }}
|
|
|
|
{% endif %}
|
2015-03-13 20:55:33 +00:00
|
|
|
|
2018-04-03 16:07:25 +00:00
|
|
|
{% if samba_server_min_protocol is defined %}
|
|
|
|
# Minimum protocol version offered by the server
|
|
|
|
server min protocol = {{ samba_server_min_protocol }}
|
|
|
|
|
2018-05-19 22:48:15 +00:00
|
|
|
{% endif %}
|
2018-04-02 21:25:51 +00:00
|
|
|
{% if samba_server_max_protocol is defined %}
|
|
|
|
# Maximum protocol version offered by the server
|
|
|
|
server max protocol = {{ samba_server_max_protocol }}
|
|
|
|
|
2018-05-19 22:48:15 +00:00
|
|
|
{% endif %}
|
2016-07-29 07:54:33 +00:00
|
|
|
{% if samba_interfaces|length > 0 %}
|
2016-07-15 18:58:30 +00:00
|
|
|
interfaces = {{ samba_interfaces }}
|
|
|
|
|
2018-05-19 22:48:15 +00:00
|
|
|
{% endif %}
|
2015-03-13 20:55:33 +00:00
|
|
|
# Name resolution: make sure \\NETBIOS_NAME\ works
|
2017-08-06 22:25:33 +00:00
|
|
|
wins support = {{ samba_wins_support | ternary('yes', 'no') }}
|
|
|
|
local master = {{ samba_local_master | ternary('yes', 'no') }}
|
|
|
|
domain master = {{ samba_domain_master | ternary('yes', 'no') }}
|
|
|
|
preferred master = {{ samba_preferred_master | ternary('yes', 'no') }}
|
2015-03-13 20:55:33 +00:00
|
|
|
|
2015-11-05 09:44:05 +00:00
|
|
|
{% if not samba_load_printers %}
|
2015-03-13 20:55:33 +00:00
|
|
|
# Don't load printers
|
|
|
|
load printers = no
|
|
|
|
printing = bsd
|
|
|
|
printcap name = /dev/null
|
|
|
|
disable spoolss = yes
|
2018-05-23 13:48:32 +00:00
|
|
|
{% else %}
|
|
|
|
load printers = yes
|
|
|
|
printing = {{ samba_printer_type }}
|
|
|
|
printcap name = {{ samba_printer_type }}
|
2018-05-23 13:57:01 +00:00
|
|
|
{% if samba_printer_type == 'cups' %}
|
2018-05-23 13:48:32 +00:00
|
|
|
cups server = {{ samba_cups_server }}
|
|
|
|
{% endif %}
|
2015-03-13 20:55:33 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2017-12-25 07:51:53 +00:00
|
|
|
{% if samba_mitigate_cve_2017_7494 %}
|
2017-05-29 18:51:00 +00:00
|
|
|
# Fix for CVE-2017-7494
|
|
|
|
# https://access.redhat.com/security/cve/cve-2017-7494
|
|
|
|
nt pipe support = no
|
2017-12-25 07:51:53 +00:00
|
|
|
{% endif %}
|
2017-05-29 18:51:00 +00:00
|
|
|
|
2015-11-05 09:44:05 +00:00
|
|
|
{% if samba_load_homes %}
|
2015-03-13 20:55:33 +00:00
|
|
|
## Make home directories accessible
|
|
|
|
[homes]
|
|
|
|
comment = Home Directories
|
|
|
|
browseable = no
|
|
|
|
writable = yes
|
|
|
|
{% endif %}
|
|
|
|
|
2016-07-29 07:54:33 +00:00
|
|
|
{% if samba_shares|length > 0 %}
|
2015-11-05 10:13:00 +00:00
|
|
|
## Shared directories
|
2015-03-13 20:55:33 +00:00
|
|
|
{% for share in samba_shares %}
|
|
|
|
[{{ share.name }}]
|
2015-11-05 10:13:00 +00:00
|
|
|
{% if share.comment is defined %}
|
2015-03-13 23:32:37 +00:00
|
|
|
comment = {{ share.comment }}
|
2015-11-05 10:13:00 +00:00
|
|
|
{% endif %}
|
2017-05-09 08:02:14 +00:00
|
|
|
{% if share.vfs_objects is defined and share.vfs_objects|length > 0 %}
|
2017-05-03 02:15:34 +00:00
|
|
|
vfs objects = {% for obj in share.vfs_objects %}{{obj.name}} {% endfor %}
|
|
|
|
|
|
|
|
{% for obj in share.vfs_objects %}
|
2017-05-03 02:48:19 +00:00
|
|
|
{% if obj.options is defined %}
|
2017-05-03 02:15:34 +00:00
|
|
|
{% if obj.options|length > 0 %}
|
|
|
|
{% for opt in obj.options %}
|
|
|
|
{{ obj.name }}:{{ opt.name }} = {{ opt.value }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2017-05-03 02:48:19 +00:00
|
|
|
{% endif %}
|
2017-05-03 02:15:34 +00:00
|
|
|
{% endfor %}{% endif %}
|
2016-01-02 06:37:59 +00:00
|
|
|
path = {{ share.path|default([samba_shares_root,share.name]|join('/')) }}
|
2015-03-13 23:32:37 +00:00
|
|
|
public = {{ share.public|default('no') }}
|
2015-11-05 10:13:00 +00:00
|
|
|
{% if share.valid_users is defined %}
|
2015-03-14 00:17:48 +00:00
|
|
|
valid users= {{ share.valid_users }}
|
2015-11-05 10:13:00 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if share.write_list is defined %}
|
2015-03-13 23:32:37 +00:00
|
|
|
write list = {{ share.write_list }}
|
2015-11-05 10:13:00 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if share.group is defined %}
|
2015-03-14 00:00:48 +00:00
|
|
|
force group = {{ share.group }}
|
2017-03-10 17:55:02 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if share.guest_ok is defined %}
|
2017-05-09 08:30:52 +00:00
|
|
|
guest ok = {{ share.guest_ok }}
|
2017-03-10 17:55:02 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if share.writable is defined %}
|
2017-05-09 08:30:52 +00:00
|
|
|
writable = {{ share.writable }}
|
2015-11-05 10:13:00 +00:00
|
|
|
{% endif %}
|
2015-03-13 23:32:37 +00:00
|
|
|
create mode = {{ share.create_mode|default('0664') }}
|
|
|
|
force create mode = {{ share.force_create_mode|default('0664') }}
|
|
|
|
directory mode = {{ share.directory_mode|default('0775') }}
|
|
|
|
force directory mode = {{ share.force_directory_mode|default('0775') }}
|
2015-11-05 10:13:00 +00:00
|
|
|
|
2015-03-13 20:55:33 +00:00
|
|
|
{% endfor %}
|
|
|
|
{% endif%}
|