-
Notifications
You must be signed in to change notification settings - Fork 11
/
playbook.yml
102 lines (98 loc) · 2.81 KB
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
---
- name: Provision {{ application_name }} with Ansible
hosts: all
gather_facts: no
sudo: yes
sudo_user: root
remote_user: ubuntu
vars:
#top level vars
- application_user:
#for password, ie python -c "from passlib.hash import sha512_crypt; print sha512_crypt.encrypt('your-password')"
- application_user_password_hash:
- application_group:
- application_name: # Has to be the name of your Django project. Ie same name as the folder containing settings.py
- update_apt_cache: yes
#Postgresql
- db_name:
- db_user:
- db_password:
- db_host:
- postgresql_version: 9.3
#Web
- virtualenv_path: '/webapps/{{ application_name }}'
- git_root: '{{ virtualenv_path }}/{{ application_name }}'
- django_dir: '{{ git_root }}/{{ application_name }}' # Location of manage.py
- application_log_dir: '{{ virtualenv_path }}/logs'
- requirements_file: '{{ git_root }}/requirements.txt'
#(Web) Gunicorn
- gunicorn_user: '{{ application_user }}'
- gunicorn_group: '{{ application_group }}'
- gunicorn_num_workers: 1
- gunicorn_max_requests: 0
#(Web) Django
- django_settings_file: '{{ application_name }}.live_settings'
- django_secret_key: ''
- run_django_syncdb: yes
- run_django_migrations: yes
- run_django_collectstatic: yes
#(Web) Git
- setup_git_repo: yes
- git_repo: ''
#(Web) Nginx
- nginx_server_name: localhost
- nginx_http_port: 80
- nginx_https_port: 443
- nginx_access_log_file: "{{ application_log_dir }}/nginx/nginx_access.log"
- nginx_error_log_file: "{{ application_log_dir }}/nginx/nginx_error.log"
- nginx_static_dir: "{{ git_root }}/static/"
- nginx_media_dir: "{{ git_root }}/media/"
# Extras...
#Mysql
#- mysql_db_user:
#- mysql_db_name:
#- mysql_db_password:
#- mysql_port: 3306
#RDS
#- create_rds: yes
#- aws_zone: ''
#- aws_region: ''
#- rds_vpc_security_groups: ''
#- rds_subnet_group: ''
#- rds_port: ''
#- rds_instance: ''
#- rds_size: ''
#Mongo
#- mongo_db_name: ''
#- mongo_db_user: ''
#- mongo_db_group: ''
#- mongo_db_password: ''
#- mongo_db_host: ''
#- mongodb_package: ''
#Memcached
#- memcached_listen: 127.0.0.1
#- memcached_port: 11211
#- memcached_user: nobody
#- memcached_max_memory_mb: 64
#- memcached_max_connections: 1024
#Backup (rudimentary)
#- aws_access_key_id_for_backups: ''
#- aws_secret_access_key_for_backups: ''
#- aws_backup_tag: ''
#- ec2_region_endpoint: ''
#Good practice if you want to move vars from here..
#vars_files:
# - vars/local
# - vars/dev
# - vars/production
roles:
- postgresql
- web
#- memcached
#- backup
#- mysql
#- rds
#- nodejs
#- celery
#- mongo
#- es