diff --git a/roles/common/templates/root/bin/samba/conf/clean_samba_trash.conf.j2 b/roles/common/templates/root/bin/samba/conf/clean_samba_trash.conf.j2 index 040981e..1fb3b14 100644 --- a/roles/common/templates/root/bin/samba/conf/clean_samba_trash.conf.j2 +++ b/roles/common/templates/root/bin/samba/conf/clean_samba_trash.conf.j2 @@ -25,7 +25,9 @@ {%- for item in samba_shares | default([]) %} {% if (item.vfs_object_recycle is defined and item.vfs_object_recycle|bool) %} +{% if item.recycle_path is defined and item.recycle_path|length > 0 %} {% set count.trash_dirs = count.trash_dirs + 1 %} +{% endif %} {% endif %} {% endfor %} @@ -33,7 +35,9 @@ trash_dirs=" {% for item in samba_shares %} {% if (item.vfs_object_recycle is defined and item.vfs_object_recycle|bool) %} +{% if item.recycle_path is defined and item.recycle_path|length > 0 %} {{ item.path }}/{{ item.recycle_path }} +{% endif %} {% endif %} {% endfor %} " diff --git a/roles/common/templates/root/bin/samba/conf/set_permissions_samba_shares.conf.j2 b/roles/common/templates/root/bin/samba/conf/set_permissions_samba_shares.conf.j2 index 23b886c..a7909c9 100644 --- a/roles/common/templates/root/bin/samba/conf/set_permissions_samba_shares.conf.j2 +++ b/roles/common/templates/root/bin/samba/conf/set_permissions_samba_shares.conf.j2 @@ -27,7 +27,11 @@ {% if count.samba_shares > 0 %} dir_permissions=" {% for item in samba_shares | default([]) %} - {{ item.path }}:{{ item.group_write_list }}:{{ item.file_create_mask | default('0660') }}:{{ item.dir_create_mask | default('2770') }}; +{% if item.file_create_mask is defined and item.file_create_mask|length > 0 + and item.dir_create_mask is defined and item.dir_create_mask|length > 0 + and item.group_write_list is defined and item.group_write_list|length > 0 %} + {{ item.path }}:{{ item.group_write_list | default('root', true) }}:{{ item.file_create_mask|string | default('660', true) }}:{{ item.dir_create_mask | default('2770', true) }}; +{% endif %} {% endfor %} " {% endif %}