From 812082a8f23a534b649fc3a7a991407e66bef156 Mon Sep 17 00:00:00 2001 From: morbidick Date: Fri, 10 Mar 2017 18:55:02 +0100 Subject: [PATCH] add new options guest_account, share.writable, share.guest_ok --- README.md | 3 +++ templates/smb.conf.j2 | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 2fc47ef..3b79938 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ No specific requirements | `samba_shares_root` | `/srv/shares` | Directories for the shares are created under this directory. | | `samba_users` | [] | List of dicts defining users that can access shares. | | `samba_workgroup` | `WORKGROUP` | Name of the server workgroup. | +| `samba_guest_account` | - | Guest account for unknown users | ### Defining users @@ -112,6 +113,8 @@ A complete overview of share options follows below. Only `name` is required, the | `setype` | `samba_share_t` | The SELinux type of the share directory | | `valid_users` | - | Controls read access for registered users. Use the syntax of the corresponding Samba setting. | | `write_list` | - | Controls write access for registered users. Use the syntax of the corresponding Samba setting. | +| `guest_ok` | - | Allow guest access. | +| `writable` | - | Writable for guests. | The values for `valid_users` and `write_list` should be a comma separated list of users. Names prepended with `+` or `@` are interpreted as groups. The documentation for the [Samba configuration](https://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html) has more details on these options. diff --git a/templates/smb.conf.j2 b/templates/smb.conf.j2 index 1853d59..355344e 100644 --- a/templates/smb.conf.j2 +++ b/templates/smb.conf.j2 @@ -23,6 +23,7 @@ security = {{ samba_security }} passdb backend = {{ samba_passdb_backend }} map to guest = {{ samba_map_to_guest }} + guest account = {{ samba_guest_account }} {% if samba_interfaces|length > 0 %} interfaces = {{ samba_interfaces }} @@ -67,6 +68,12 @@ {% endif %} {% if share.group is defined %} force group = {{ share.group }} +{% endif %} +{% if share.guest_ok is defined %} + force guest_ok = {{ share.guest_ok }} +{% endif %} +{% if share.writable is defined %} + force writable = {{ share.writable }} {% endif %} create mode = {{ share.create_mode|default('0664') }} force create mode = {{ share.force_create_mode|default('0664') }}