From 3e0776eecbf90b7e0b3a1318830070ff0c749320 Mon Sep 17 00:00:00 2001 From: Bert Van Vreckem Date: Thu, 12 May 2016 10:07:44 +0200 Subject: [PATCH] Moved webserver document root to vars (and fixed path for Debian) --- tasks/main.yml | 13 +++++++------ vars/os_Debian.yml | 2 ++ vars/os_RedHat.yml | 2 ++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 2ad0390..10d1b9a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -50,17 +50,18 @@ when: samba_shares tags: samba -- name: Check if /var/www/html exists +- name: Check if webserver document root exists when: samba_create_varwww_symlinks - stat: path=/var/www/html - register: var_www_html + stat: + path: "{{ samba_www_documentroot }}" + register: documentroot tags: samba -- name: Create link to shares in /var/www/html - when: var_www_html.stat.isdir is defined and var_www_html.stat.isdir == true +- name: Create link to shares in webserver document root + when: documentroot.stat.isdir is defined and documentroot.stat.isdir == true file: state: link - path: "/var/www/html/{{ item.name }}" + path: "{{ samba_www_documentroot }}/{{ item.name }}" src: "{{ item.path|default([samba_shares_root,item.name]|join('/')) }}" with_items: "{{ samba_shares }}" tags: samba diff --git a/vars/os_Debian.yml b/vars/os_Debian.yml index 9cfd02f..89032b8 100644 --- a/vars/os_Debian.yml +++ b/vars/os_Debian.yml @@ -11,3 +11,5 @@ samba_selinux_booleans: [] samba_service: smbd winbind_service: nmbd + +samba_www_documentroot: /var/www diff --git a/vars/os_RedHat.yml b/vars/os_RedHat.yml index 16c4a41..666c059 100644 --- a/vars/os_RedHat.yml +++ b/vars/os_RedHat.yml @@ -15,3 +15,5 @@ samba_selinux_booleans: samba_service: smb winbind_service: nmb + +samba_www_documentroot: /var/www/html