Add configuration for primary vds
This commit is contained in:
commit
7e81d6fe00
13
.editorconfig
Normal file
13
.editorconfig
Normal file
@ -0,0 +1,13 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.{yml}]
|
||||
indent_size = 2
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/ansible/galaxy.roles/
|
2
Makefile
Normal file
2
Makefile
Normal file
@ -0,0 +1,2 @@
|
||||
configure:
|
||||
ansible-playbook --inventory "ansible/hosts_prod" --user=av --ask-become-pass ansible/configuration.yml
|
2
ansible.cfg
Normal file
2
ansible.cfg
Normal file
@ -0,0 +1,2 @@
|
||||
[defaults]
|
||||
roles_path = ./ansible/galaxy.roles
|
14
ansible/configuration.yml
Normal file
14
ansible/configuration.yml
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
- hosts: all
|
||||
become: true
|
||||
|
||||
vars:
|
||||
timezone: UTC
|
||||
nginx_remove_default_vhost: true
|
||||
|
||||
roles:
|
||||
- yatesr.timezone
|
||||
- geerlingguy.nginx
|
||||
- server
|
||||
- site-anwinged
|
||||
- site-s2photo
|
1
ansible/hosts_prod
Normal file
1
ansible/hosts_prod
Normal file
@ -0,0 +1 @@
|
||||
188.225.32.183
|
6
ansible/requirements.yml
Normal file
6
ansible/requirements.yml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
- src: yatesr.timezone
|
||||
version: 1.0.0
|
||||
|
||||
- src: geerlingguy.nginx
|
||||
version: 1.9.6
|
16
ansible/roles/server/tasks/main.yml
Executable file
16
ansible/roles/server/tasks/main.yml
Executable file
@ -0,0 +1,16 @@
|
||||
---
|
||||
- name: Update apt cache
|
||||
apt: update_cache=yes
|
||||
|
||||
- name: Install system packages
|
||||
apt: pkg={{ item }} state=latest
|
||||
with_items:
|
||||
- curl
|
||||
- wget
|
||||
- python-software-properties
|
||||
- git
|
||||
|
||||
- name: Add deploy user
|
||||
user:
|
||||
name: deployer
|
||||
groups: www-data
|
15
ansible/roles/site-anwinged/tasks/main.yml
Executable file
15
ansible/roles/site-anwinged/tasks/main.yml
Executable file
@ -0,0 +1,15 @@
|
||||
---
|
||||
- name: Create nginx config
|
||||
template:
|
||||
src: site.conf.j2
|
||||
dest: /etc/nginx/sites-enabled/anwinged.conf
|
||||
notify: restart nginx
|
||||
|
||||
- name: Create root folder
|
||||
file:
|
||||
path: /var/www/anwinged
|
||||
state: directory
|
||||
owner: deployer
|
||||
group: www-data
|
||||
recurse: yes
|
||||
notify: restart nginx
|
15
ansible/roles/site-anwinged/templates/site.conf.j2
Executable file
15
ansible/roles/site-anwinged/templates/site.conf.j2
Executable file
@ -0,0 +1,15 @@
|
||||
server {
|
||||
server_name www.anwinged.ru;
|
||||
return 301 $scheme://anwinged.ru$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name anwinged.ru;
|
||||
|
||||
location / {
|
||||
root /var/www/anwinged/current;
|
||||
index index.html;
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
14
ansible/roles/site-s2photo/tasks/main.yml
Executable file
14
ansible/roles/site-s2photo/tasks/main.yml
Executable file
@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: Create nginx config
|
||||
template:
|
||||
src: site.conf.j2
|
||||
dest: /etc/nginx/sites-enabled/s2photo.conf
|
||||
notify: restart nginx
|
||||
|
||||
- name: Create root folder
|
||||
file:
|
||||
path: /var/www/s2photo
|
||||
state: directory
|
||||
owner: deployer
|
||||
group: deployer
|
||||
mode: u=rw,g=r,o=r
|
10
ansible/roles/site-s2photo/templates/site.conf.j2
Executable file
10
ansible/roles/site-s2photo/templates/site.conf.j2
Executable file
@ -0,0 +1,10 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name s2photo.ru www.s2photo.ru;
|
||||
|
||||
location / {
|
||||
root /var/www/s2photo/current;
|
||||
index index.html;
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user