Add server configuration playbook

This commit is contained in:
Anton Vakhrushev 2017-01-21 16:05:53 +03:00
parent b7eeee4085
commit 72ccc89765
5 changed files with 42 additions and 26 deletions

View File

@ -4,3 +4,6 @@ deploy:
rollback:
ansible-playbook --inventory "ansible/hosts_prod" --user=deployer ansible/rollback.yml
configure:
ansible-playbook --inventory "ansible/hosts_prod" --user=av --ask-become-pass ansible/configuration.yml

16
ansible/configuration.yml Normal file
View File

@ -0,0 +1,16 @@
---
- hosts: all
become: true
vars:
timezone: UTC
nginx_conf_name: 'anwinged.ru.conf'
nginx_conf_root: '{{ application_root }}/current'
nginx_conf_domain: 'anwinged.ru'
nginx_remove_default_vhost: true
roles:
- yatesr.timezone
- geerlingguy.nginx
- nginx

View File

@ -5,8 +5,10 @@ server {
location / {
root {{ nginx_conf_root }};
index index.html;
try_files $uri /index.html;
try_files $uri $uri/ =404;
}
{% if not nginx_conf_sendfile|default(true) %}
sendfile off;
{% endif %}
}

View File

@ -1,8 +1,26 @@
---
- hosts: all
vars_files:
- vars/all.yml
vars:
application_root: /vagrant
timezone: UTC
nginx_conf_name: anwinged.conf
nginx_conf_root: '{{ application_root }}/output_dev'
nginx_conf_domain: anwinged.ru
nginx_conf_sendfile: false
nginx_remove_default_vhost: true
php_enable_webserver: false
php_packages:
- php7.1
- php7.1-mbstring
- php7.1-intl
- php7.1-curl
- php7.1-xml
pre_tasks:
- name: Ensure that PHP Ondrej PPA is added

View File

@ -1,23 +0,0 @@
---
application_root: /vagrant
site:
www_dir: anwinged
domain: anwinged.ru
conf_name: anwinged.conf
timezone: UTC
nginx_conf_name: 'anwinged.conf'
nginx_conf_root: '{{ application_root }}/output_dev'
nginx_conf_domain: 'anwinged'
nginx_remove_default_vhost: true
php_enable_webserver: false
php_packages:
- php7.1
- php7.1-mbstring
- php7.1-intl
- php7.1-curl
- php7.1-xml