Merge pull request #5 from iangreenleaf/share-path

Allow specific path for shares
This commit is contained in:
Bert Van Vreckem 2016-05-12 07:29:42 +02:00
commit 5d5b899fad
3 changed files with 4 additions and 3 deletions

View File

@ -97,6 +97,7 @@ A complete overview of share options follows below. Only `name` is required, the
| Option | Default | Comment | | Option | Default | Comment |
| :--- | :--- | :--- | | :--- | :--- | :--- |
| `name` | - | The name of the share. | | `name` | - | The name of the share. |
| `path` | /{{samba_shares_root}}/{{name}} | The path to the share directory. |
| `comment` | - | A comment string for the share | | `comment` | - | A comment string for the share |
| `public` | `no` | Controls read access for guest users | | `public` | `no` | Controls read access for guest users |
| `valid_users` | - | Controls read access for registered users. Use the syntax of the corresponding Samba setting. | | `valid_users` | - | Controls read access for registered users. Use the syntax of the corresponding Samba setting. |

View File

@ -36,7 +36,7 @@
with_items: samba_shares with_items: samba_shares
file: file:
state: directory state: directory
path: "{{ samba_shares_root}}/{{ item.name }}" path: "{{ item.path|default([samba_shares_root,item.name]|join('/')) }}"
owner: root owner: root
group: "{{ item.group|default('users') }}" group: "{{ item.group|default('users') }}"
mode: "{{ item.directory_mode|default('0775') }}" mode: "{{ item.directory_mode|default('0775') }}"
@ -55,7 +55,7 @@
file: file:
state: link state: link
path: "/var/www/html/{{ item.name }}" path: "/var/www/html/{{ item.name }}"
src: "{{ samba_shares_root }}/{{ item.name }}" src: "{{ item.path|default([samba_shares_root,item.name]|join('/')) }}"
with_items: samba_shares with_items: samba_shares
tags: samba tags: samba

View File

@ -53,7 +53,7 @@
{% if share.comment is defined %} {% if share.comment is defined %}
comment = {{ share.comment }} comment = {{ share.comment }}
{% endif %} {% endif %}
path = {{ samba_shares_root }}/{{ share.name }} path = {{ share.path|default([samba_shares_root,share.name]|join('/')) }}
public = {{ share.public|default('no') }} public = {{ share.public|default('no') }}
{% if share.valid_users is defined %} {% if share.valid_users is defined %}
valid users= {{ share.valid_users }} valid users= {{ share.valid_users }}