From 4e845d4141ecf4c206440bd377e93322d3f1e654 Mon Sep 17 00:00:00 2001 From: Bert Van Vreckem Date: Fri, 29 Jul 2016 09:54:33 +0200 Subject: [PATCH] Give samba_interfaces a default value --- defaults/main.yml | 1 + templates/smb.conf.j2 | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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 }}]