From 39c5bb3a9cce0cacd19a2776923b88d075130cfc Mon Sep 17 00:00:00 2001 From: Bert Van Vreckem Date: Thu, 12 May 2016 10:19:00 +0200 Subject: [PATCH] Ensure webserver document root exists; move hard coded config file name to vars --- tasks/main.yml | 12 +++++------- vars/os_Debian.yml | 2 ++ vars/os_RedHat.yml | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 10d1b9a..3088a01 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -50,15 +50,13 @@ when: samba_shares tags: samba -- name: Check if webserver document root exists - when: samba_create_varwww_symlinks - stat: - path: "{{ samba_www_documentroot }}" - register: documentroot +- name: Ensute webserver document root exists + file: + name: "{{ samba_www_documentroot }}" + state: directory tags: samba - name: Create link to shares in webserver document root - when: documentroot.stat.isdir is defined and documentroot.stat.isdir == true file: state: link path: "{{ samba_www_documentroot }}/{{ item.name }}" @@ -68,7 +66,7 @@ - name: Samba configuration template: - dest: /etc/samba/smb.conf + dest: "{{ samba_configuration }}" src: smb.conf.j2 validate: 'testparm -s %s' notify: diff --git a/vars/os_Debian.yml b/vars/os_Debian.yml index 89032b8..a467b52 100644 --- a/vars/os_Debian.yml +++ b/vars/os_Debian.yml @@ -9,6 +9,8 @@ samba_packages: samba_selinux_packages: [] samba_selinux_booleans: [] +samba_configuration: /etc/samba/smb.conf + samba_service: smbd winbind_service: nmbd diff --git a/vars/os_RedHat.yml b/vars/os_RedHat.yml index 666c059..ee8ff6e 100644 --- a/vars/os_RedHat.yml +++ b/vars/os_RedHat.yml @@ -13,6 +13,8 @@ samba_selinux_booleans: - samba_enable_home_dirs - samba_export_all_rw +samba_configuration: /etc/samba/smb.conf + samba_service: smb winbind_service: nmb