From 91d6b6de8b9f9864977f11a647d644454899686d Mon Sep 17 00:00:00 2001
From: Stephane Armanet <stephanearmanet@esss.lu.se>
Date: Mon, 9 Sep 2019 11:09:07 +0200
Subject: [PATCH] add netbios hostname as variable for host with more than 15
 chars names

---
 defaults/main.yml     | 1 +
 templates/smb.conf.j2 | 1 +
 2 files changed, 2 insertions(+)

diff --git a/defaults/main.yml b/defaults/main.yml
index 6a4a052..1afebdf 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -2,6 +2,7 @@
 smb_interface: eth0
 
 smb_domain: "TEST"
+smb_netbios_name: "{{ inventory_hostname_short }}"
 
 sophos_pkg: http://artifactory.esss.lu.se/artifactory/swi-pkg/sophos/sophos-av.9.15.1.tar.bz2
 sophos_install_opts: "--update-free --acceptlicence --autostart=true --enableOnBoot=true --automatic --ignore-existing-installation --update-source-type=f --update-period=1 --preferFanotify=true"
diff --git a/templates/smb.conf.j2 b/templates/smb.conf.j2
index 3977f24..de793a2 100644
--- a/templates/smb.conf.j2
+++ b/templates/smb.conf.j2
@@ -2,6 +2,7 @@
 [global]
        workgroup = {{ smb_domain }}
         security = ADS
+        netbios name = "{{ smb_netbios_name }}"
 
         log level = 3
         log file = /var/log/samba/samba.log
-- 
GitLab