ansible WIP

This commit is contained in:
Benoît Burnichon
2015-11-25 18:48:16 +01:00
committed by Thibaud Fabre
parent 23fda9f81e
commit 0057cccdfe
2059 changed files with 630 additions and 122635 deletions

View File

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

View File

@@ -0,0 +1,9 @@
---
- name: Install Nginx
sudo: yes
apt: pkg=nginx state=latest
- name: Change default nginx site
sudo: yes
template: src=default.j2 dest=/etc/nginx/sites-available/default
notify: restart nginx

View File

@@ -0,0 +1,75 @@
server {
listen 80;
root {{ nginx.docroot }};
index index.html index.php;
server_name dev.{{ hostname }}.vb;
location @rewriteapp {
root {{ nginx.docroot }}/www;
index index.html index.htm index.php;
rewrite ^(.*)$ /index_dev.php/$1 last;
}
location / {
root {{ nginx.docroot }}/www;
try_files $uri $uri/ @rewriteapp;
}
location /api {
root {{ nginx.docroot }}/www;
rewrite ^(.*)$ /api.php/$1 last;
}
location ~ ^/(index|index_dev|api)\.php(/|$) {
root {{ nginx.docroot }}/www;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH /usr/local/bin:/usr/bin:/bin;
include fastcgi_params;
}
sendfile off;
client_max_body_size 2g;
}
server {
listen 80;
root {{ nginx.docroot }};
index index.html index.php;
server_name www.{{ hostname }}.vb;
location @rewriteapp {
root {{ nginx.docroot }}/www;
index index.html index.htm index.php;
rewrite ^(.*)$ /index.php/$1 last;
}
location / {
root {{ nginx.docroot }}/www;
try_files $uri $uri/ @rewriteapp;
}
location /api {
root {{ nginx.docroot }}/www;
rewrite ^(.*)$ /api.php/$1 last;
}
location ~ ^/(index|index_dev|api)\.php(/|$) {
root {{ nginx.docroot }}/www;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH /usr/local/bin:/usr/bin:/bin;
include fastcgi_params;
}
sendfile off;
client_max_body_size 2g;
}