From 07fa5384f8cf4ba653044f53ffdf29717317bb0a Mon Sep 17 00:00:00 2001 From: Ivan Grynenko Date: Sat, 11 Jun 2016 11:38:18 +1000 Subject: [PATCH] Attempting to create nginx vhost folder --- lemp-rhel7/roles/ansible-role-nginx/tasks/vhosts.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lemp-rhel7/roles/ansible-role-nginx/tasks/vhosts.yml b/lemp-rhel7/roles/ansible-role-nginx/tasks/vhosts.yml index 583ff77..00ed30f 100755 --- a/lemp-rhel7/roles/ansible-role-nginx/tasks/vhosts.yml +++ b/lemp-rhel7/roles/ansible-role-nginx/tasks/vhosts.yml @@ -16,6 +16,12 @@ notify: - reload nginx +- name: Creates Nginx vhost directory + file: path=/var/www/html/{{ server_hostname }} state=directory owner={{ nginx_user }} group={{ nginx_user }} mode=0775 recurse=yes + when: nginx_vhosts|length > 0 + notify: + - reload nginx + - name: Remove managed vhost config file (if no vhosts are configured). file: path: "{{ nginx_vhost_path }}/vhosts.conf"