summaryrefslogtreecommitdiff
path: root/roles/webserver/tasks/enable-virtualhosts.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/webserver/tasks/enable-virtualhosts.yml')
-rw-r--r--roles/webserver/tasks/enable-virtualhosts.yml12
1 files changed, 12 insertions, 0 deletions
diff --git a/roles/webserver/tasks/enable-virtualhosts.yml b/roles/webserver/tasks/enable-virtualhosts.yml
new file mode 100644
index 0000000..3734900
--- /dev/null
+++ b/roles/webserver/tasks/enable-virtualhosts.yml
@@ -0,0 +1,12 @@
+---
+- name: Ensure virtualhost configuration file exists
+ template:
+ src: virtualhosts/exchange-nginx.conf.j2
+ dest: "{{ NGINX_SITES_AVAILABLE }}/{{ VIRTUALHOST }}"
+ notify: Reload Nginx
+
+- name: Enable virtual host by creating symlink
+ file:
+ src: "{{ NGINX_SITES_AVAILABLE }}/{{ VIRTUALHOST }}"
+ dest: "{{ NGINX_SITES_ENABLED }}/{{ VIRTUALHOST }}"
+ state: link