Reconfigure vagrant

This commit is contained in:
2016-12-31 10:21:27 +03:00
parent 0d316aac6c
commit ec822f1441
12 changed files with 77 additions and 131 deletions

View File

@ -1,3 +0,0 @@
---
- name: restart nginx
service: name=nginx enabled=yes state=restarted

View File

@ -1,33 +1,6 @@
---
- name: Install Nginx
become: yes
apt: pkg=nginx state=latest
- name: Create nginx congig
become: yes
- name: Create nginx config
template:
src: homepage.j2
dest: /etc/nginx/sites-available/{{ site.domain }}
notify: restart nginx
- name: Create symlink to site
become: yes
file:
src: /etc/nginx/sites-available/{{ site.domain }}
dest: /etc/nginx/sites-enabled/{{ site.domain }}
state: link
notify: restart nginx
- name: Delete default site
become: yes
file:
path: /etc/nginx/sites-available/default
state: absent
notify: restart nginx
- name: Delete default site symlink
become: yes
file:
path: /etc/nginx/sites-enabled/default
state: absent
src: site.conf.j2
dest: /etc/nginx/sites-enabled/{{ nginx_conf_name }}
notify: restart nginx

View File

@ -1,10 +0,0 @@
server {
listen 80;
server_name {{ site.domain }} www.{{ site.domain }};
location / {
root /var/www/{{ site.www_dir }}/current/web;
index index.html;
try_files $uri /index.html;
}
}

View File

@ -0,0 +1,12 @@
server {
listen 80;
server_name {{ nginx_conf_domain }} www.{{ nginx_conf_domain }};
location / {
root {{ nginx_conf_root }};
index index.html;
try_files $uri /index.html;
}
sendfile off;
}