diff --git a/README.md b/README.md index e5ca7fc..bdbc8d2 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ No specific requirements | `samba_log` | - | Set the log file. If left undefined, logging is done through syslog. | | `samba_log_size` | 5000 | Set the maximum size of the log file. | | `samba_log_level` | 0 | Set Samba log level, 0 is least verbose and 10 is a flood of debug output. | +| `samba_mdns_name` | `netbios` | The name advertised via multicast DNS. | | `samba_map_to_guest` | `bad user` | Behaviour when unregistered users access the shares. | | `samba_mitigate_cve_2017_7494` | true | CVE-2017-7494 mitigation breaks some clients, such as macOS High Sierra. | | `samba_netbios_name` | `{{ ansible_hostname }}` | The NetBIOS name of this server. | diff --git a/defaults/main.yml b/defaults/main.yml index 3857e2c..0c393f5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -9,6 +9,7 @@ samba_interfaces: [] samba_security: 'user' samba_passdb_backend: 'tdbsam' samba_map_to_guest: 'never' +samba_mdns_name: 'netbios' samba_load_printers: false samba_printer_type: 'cups' samba_cups_server: 'localhost:631' diff --git a/templates/smb.conf.j2 b/templates/smb.conf.j2 index 2cb9c70..b89acec 100644 --- a/templates/smb.conf.j2 +++ b/templates/smb.conf.j2 @@ -7,6 +7,8 @@ # Server information netbios name = {% if samba_netbios_name is defined %}{{ samba_netbios_name }}{% else %}{{ ansible_hostname }}{% endif %} + mdns name = {% if samba_mdns_name is defined %}{{ samba_mdns_name }}{% else %}netbios{% endif %} + workgroup = {{ samba_workgroup }} {% if samba_realm is defined %} realm = {{ samba_realm }}