-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yml
59 lines (46 loc) · 1.6 KB
/
main.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
###########################################################################################################
# This is the main playbook that can be run on a fresh ubuntu server to install and setup a Production ready Django Project
###################################################################################################################
---
- hosts: local
roles:
- local_ssh
- hosts: web
vars_files: roles/global/vars/main.yml
handlers:
- include: roles/global/handlers/main.yml # Please note role specific handlers or global handlers can be overriden by adding them to that role's handlers/main.yml file
roles:
- role: user_setup
gather_facts: false
vars:
ansible_user: root
sys_packages: [ 'curl', 'vim', 'git', 'ufw', 'memcached', 'libmemcached-tools']
- role: postgres_setup
become: yes
vars:
sys_packages: ["python3-pip", "python3-dev", "libpq-dev", "postgresql", "postgresql-contrib"]
- role: django_setup
- role: gunicorn_setup
become: yes
- role: nginx_setup
become: yes
vars:
sys_packages: [ "nginx" ]
- role: ssl_setup
become: yes
become_user: root
vars:
apache_vhosts:
- {servername: '{{domain_name}}'}
- {servername: 'www.{{domain_name}}'}
- role: mail_setup
become: yes
become_method: sudo
vars:
sys_packages: ['mailutils']
ansible_user: root
- role: security_setup
become: yes
vars:
sys_packages: [ 'unattended-upgrades', 'fail2ban']
ansible_user: root