Fix #37 by removing inconsistencies in variable naming of

`samba_homes_include`
This commit is contained in:
Bert Van Vreckem 2019-06-22 17:16:09 +02:00
parent ce95f7adfb
commit 03a1920252
3 changed files with 41 additions and 38 deletions

View File

@ -39,7 +39,7 @@ No specific requirements
| `samba_domain_master` | true | When true, smbd enables WAN-wide browse list collation | | `samba_domain_master` | true | When true, smbd enables WAN-wide browse list collation |
| `samba_global_include` | - | Samba-compatible configuration file with options to be loaded to [global] section (see below) | | `samba_global_include` | - | Samba-compatible configuration file with options to be loaded to [global] section (see below) |
| `samba_guest_account` | - | Guest account for unknown users | | `samba_guest_account` | - | Guest account for unknown users |
| `samba_home_include` | - | Samba-compatible configuration file with options to be loaded to [home] section (see below) | | `samba_homes_include` | - | Samba-compatible configuration file with options to be loaded to [homes] section (see below) |
| `samba_interfaces` | [] | List of network interfaces used for browsing, name registration, etc. | | `samba_interfaces` | [] | List of network interfaces used for browsing, name registration, etc. |
| `samba_load_homes` | false | When true, user home directories are accessible. | | `samba_load_homes` | false | When true, user home directories are accessible. |
| `samba_load_printers` | false | When true, printers attached to the host are shared | | `samba_load_printers` | false | When true, printers attached to the host are shared |
@ -174,7 +174,7 @@ The values for `valid_users` and `write_list` should be a comma separated list o
## Adding arbitrary configuration files ## Adding arbitrary configuration files
You can add settings that are not supported by this role out-of-the-box through custom configuration files that will be included from the main configuration file. There are three types of include files: for the global section, for the homes section, and for individual shares. Put your custom configuration files in a subdirectory `templates`, relative to your master playbook location. Then, specify them in the variables `samba_global_include`, `samba_home_include`, or `include_file` in the `samba_shares` definition. You can add settings that are not supported by this role out-of-the-box through custom configuration files that will be included from the main configuration file. There are three types of include files: for the global section, for the homes section, and for individual shares. Put your custom configuration files in a subdirectory `templates`, relative to your master playbook location. Then, specify them in the variables `samba_global_include`, `samba_homes_include`, or `include_file` in the `samba_shares` definition.
Your custom configuration files are considered to be Jinja templates, so you can use Ansible variables inside them. The configuration files will be validated to ensure they are syntactically correct. Your custom configuration files are considered to be Jinja templates, so you can use Ansible variables inside them. The configuration files will be validated to ensure they are syntactically correct.

View File

@ -94,8 +94,9 @@
when: samba_global_include is defined when: samba_global_include is defined
notify: notify:
- Restart Samba services - Restart Samba services
tags: samba
- name: Install homes include file - name: Install home include file
template: template:
src: "{{ samba_homes_include }}" src: "{{ samba_homes_include }}"
dest: "{{ samba_configuration_dir }}" dest: "{{ samba_configuration_dir }}"
@ -103,6 +104,7 @@
when: samba_homes_include is defined when: samba_homes_include is defined
notify: notify:
- Restart Samba services - Restart Samba services
tags: samba
- name: Install share specific include files - name: Install share specific include files
template: template:
@ -113,6 +115,7 @@
notify: notify:
- Restart Samba services - Restart Samba services
with_items: "{{ samba_shares }}" with_items: "{{ samba_shares }}"
tags: samba
- name: Create username map file if needed - name: Create username map file if needed
template: template:
@ -120,8 +123,8 @@
src: smbusers.j2 src: smbusers.j2
notify: notify:
- Restart Samba services - Restart Samba services
tags: samba
when: samba_username_map is defined when: samba_username_map is defined
tags: samba
- name: Start Samba service(s) - name: Start Samba service(s)
service: service:

4
templates/smb.conf.j2 Executable file → Normal file
View File

@ -90,8 +90,8 @@
writable = yes writable = yes
{% endif %} {% endif %}
{% if samba_home_include is defined %} {% if samba_homes_include is defined %}
include = {{ samba_configuration_dir }}/{{ samba_home_include }} include = {{ samba_configuration_dir }}/{{ samba_homes_include }}
{% endif %} {% endif %}
{% if samba_shares|length > 0 %} {% if samba_shares|length > 0 %}