2023-06-07 06:12:17 +00:00
|
|
|
[global]
|
|
|
|
workgroup = WORKGROUP
|
|
|
|
server string = Samba Server %v
|
|
|
|
netbios name = {{ ansible_hostname }}
|
|
|
|
security = user
|
|
|
|
map to guest = bad user
|
|
|
|
dns proxy = no
|
|
|
|
{% for user in samba.users %}
|
|
|
|
smb encrypt = {{ 'mandatory' if user.encrypt | default(false) else 'disabled' }}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
{% for share in samba.shares %}
|
|
|
|
[{{ share.name }}]
|
|
|
|
path = {{ share.path }}
|
|
|
|
browsable = yes
|
2023-06-10 02:26:47 +00:00
|
|
|
{% if share.guest_allow is defined and share.guest_allow %}
|
|
|
|
guest ok = yes
|
|
|
|
{% else %}
|
2023-06-07 06:12:17 +00:00
|
|
|
guest ok = no
|
2023-06-10 02:26:47 +00:00
|
|
|
{% endif %}
|
2023-06-07 06:12:17 +00:00
|
|
|
read only = {{ 'yes' if share.read_only | default(false) else 'no' }}
|
2023-06-10 02:26:47 +00:00
|
|
|
{% if share.valid_users is defined %}
|
2023-06-07 06:12:17 +00:00
|
|
|
valid users = {{ share.valid_users }}
|
2023-06-10 02:26:47 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if share.force_user is defined %}
|
|
|
|
force user = {{ share.force_user }}
|
|
|
|
{% endif %}
|
2023-06-07 06:12:17 +00:00
|
|
|
{% endfor %}
|