diff --git a/defaults/main.yml b/defaults/main.yml index 544bf06..868aae2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -4,6 +4,7 @@ samba_workgroup: 'WORKGROUP' samba_server_string: 'Fileserver %m' samba_log_size: 5000 +samba_interfaces: [] samba_security: 'user' samba_passdb_backend: 'tdbsam' samba_map_to_guest: 'bad user' diff --git a/templates/smb.conf.j2 b/templates/smb.conf.j2 index da0101a..1853d59 100644 --- a/templates/smb.conf.j2 +++ b/templates/smb.conf.j2 @@ -24,7 +24,7 @@ passdb backend = {{ samba_passdb_backend }} map to guest = {{ samba_map_to_guest }} -{% if samba_interfaces is defined %} +{% if samba_interfaces|length > 0 %} interfaces = {{ samba_interfaces }} {% endif %} @@ -50,7 +50,7 @@ writable = yes {% endif %} -{% if samba_shares is defined %} +{% if samba_shares|length > 0 %} ## Shared directories {% for share in samba_shares %} [{{ share.name }}]