Add server configuration playbook
This commit is contained in:
parent
b7eeee4085
commit
72ccc89765
3
Makefile
3
Makefile
@ -4,3 +4,6 @@ deploy:
|
|||||||
|
|
||||||
rollback:
|
rollback:
|
||||||
ansible-playbook --inventory "ansible/hosts_prod" --user=deployer ansible/rollback.yml
|
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
16
ansible/configuration.yml
Normal 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
|
@ -5,8 +5,10 @@ server {
|
|||||||
location / {
|
location / {
|
||||||
root {{ nginx_conf_root }};
|
root {{ nginx_conf_root }};
|
||||||
index index.html;
|
index index.html;
|
||||||
try_files $uri /index.html;
|
try_files $uri $uri/ =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{% if not nginx_conf_sendfile|default(true) %}
|
||||||
sendfile off;
|
sendfile off;
|
||||||
|
{% endif %}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,26 @@
|
|||||||
---
|
---
|
||||||
- hosts: all
|
- hosts: all
|
||||||
|
|
||||||
vars_files:
|
vars:
|
||||||
- vars/all.yml
|
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:
|
pre_tasks:
|
||||||
- name: Ensure that PHP Ondrej PPA is added
|
- name: Ensure that PHP Ondrej PPA is added
|
||||||
|
@ -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
|
|
Loading…
Reference in New Issue
Block a user