-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
56 lines (46 loc) · 1.41 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
---
- hosts: all
become: yes
vars:
python_version: 3.4
postgresql_databases:
- name: todo
roles:
- { role: ANXS.postgresql }
tasks:
- name: Ensure Python is installed
apt: name=python{{ python_version }} state=present
- name: Ensure Python setuptools are installed
apt: name=python3-setuptools state=latest
- name: Ensure pip is installed
easy_install: name=pip state=latest executable=easy_install3
- name: Ensure devel libraries and tools are installed
apt: name={{ item }} state=latest
with_items:
- libpq-dev
- libpython3-dev
- git
- name: Ensure GIT repository is updated
git: repo=https://github.com/Carlangueitor/django-vagrant-ansible.git
dest={{ root_dir }}
accept_hostkey=yes
when: env == "prod"
- name: Install Python Packages
pip: requirements={{ root_dir }}/requirements.txt
- name: Install Server requirements
apt: name={{ item }} state=present
with_items:
- nginx
- uwsgi
- uwsgi-plugin-python
when: env == "prod"
- name: Ensure wWSGI config is updated
copy: src=conf/uwsgi-todo.ini dest=/etc/uwsgi/apps-enabled/
when: env == "prod"
notify: Reload uWSGI
- name: Ensure NGIX config is updated
copy: src=conf/todo.conf dest=/etc/nginx/sites-enabled/
when: env == "prod"
notify: Reload NGINX
- name: Reload NGINX
service: name=nginx state=reloaded