Add code to install user defined custom config files

This commit is contained in:
Bert Van Vreckem 2018-10-04 23:15:28 +02:00
parent 966c80efd9
commit f6cc5f9746
4 changed files with 37 additions and 6 deletions

View File

@ -85,6 +85,34 @@
notify: notify:
- Restart Samba services - Restart Samba services
tags: samba tags: samba
- name: Install global include file
template:
src: "{{ samba_global_include }}"
dest: "{{ samba_configuration_dir }}"
validate: 'testparm -s %s'
when: samba_global_include is defined
notify:
- Restart Samba services
- name: Install homes include file
template:
src: "{{ samba_homes_include }}"
dest: "{{ samba_configuration_dir }}"
validate: 'testparm -s %s'
when: samba_homes_include is defined
notify:
- Restart Samba services
- name: Install share specific include files
template:
src: "{{ item.include_file }}"
dest: "{{ samba_configuration_dir }}"
validate: 'testparm -s %s'
when: item.include_file is defined
notify:
- Restart Samba services
with_items: "{{ samba_shares }}"
- name: Create username map file if needed - name: Create username map file if needed
template: template:

View File

@ -10,8 +10,9 @@ samba_vfs_packages: []
samba_selinux_packages: [] samba_selinux_packages: []
samba_selinux_booleans: [] samba_selinux_booleans: []
samba_configuration: /etc/samba/smb.conf samba_configuration_dir: /etc/samba
samba_username_map_file: /etc/samba/smbusers samba_configuration: "{{ samba_configuration_dir }}/smb.conf"
samba_username_map_file: "{{ samba_configuration_dir }}/smbusers"
samba_services: samba_services:
- smbd - smbd

View File

@ -12,8 +12,9 @@ samba_vfs_packages:
samba_selinux_packages: [] samba_selinux_packages: []
samba_selinux_booleans: [] samba_selinux_booleans: []
samba_configuration: /etc/samba/smb.conf samba_configuration_dir: /etc/samba
samba_username_map_file: /etc/samba/smbusers samba_configuration: "{{ samba_configuration_dir }}/smb.conf"
samba_username_map_file: "{{ samba_configuration_dir }}/smbusers"
# The name of the Samba service in older releases (Ubuntu 14.04, # The name of the Samba service in older releases (Ubuntu 14.04,
# Debian <8) is "samba". # Debian <8) is "samba".

View File

@ -15,8 +15,9 @@ samba_selinux_booleans:
- samba_enable_home_dirs - samba_enable_home_dirs
- samba_export_all_rw - samba_export_all_rw
samba_configuration: /etc/samba/smb.conf samba_configuration_dir: /etc/samba
samba_username_map_file: /etc/samba/smbusers samba_configuration: "{{ samba_configuration_dir }}/smb.conf"
samba_username_map_file: "{{ samba_configuration_dir }}/smbusers"
samba_services: samba_services:
- smb - smb