-
Notifications
You must be signed in to change notification settings - Fork 0
/
sentimeter.yml
60 lines (59 loc) · 2.22 KB
/
sentimeter.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
---
- hosts: all
sudo: True
user: ubuntu
gather_facts: True
vars:
source_list: '/etc/apt/sources.list.d/nginx.list'
nginx_default: '/etc/nginx/conf.d/default.conf'
elasticsearch_url: 'https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.4/elasticsearch-2.3.4.deb'
tasks:
- name: Create nginx source_list file
file: path=/etc/apt/sources.list.d/nginx.list state=touch
- name: setup nginx repositories
lineinfile:
dest: "{{source_list}}"
line: "{{item.line}}"
with_items:
- {line: 'deb http://nginx.org/packages/ubuntu/ trusty nginx'}
- {line: 'deb-src http://nginx.org/packages/ubuntu/ trusty nginx'}
- name: Add nginx key
apt_key: url=http://nginx.org/keys/nginx_signing.key
- name: Setting up locales
command: /usr/sbin/update-locale LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8
- name: update apt cache
apt: update_cache=yes
- name: Install required packages
apt: name={{ item }} state=installed
with_items:
- build-essential
- python-software-properties
- libjpeg-dev
- libpq-dev
- python3-pip
- python3-dev
- uwsgi
- git
- redis-server
- supervisor
- uwsgi-plugin-python3
- nginx
- postgresql-9.3
- openjdk-7-jre
- python-psycopg2
- name: Download elasticsearch .deb packge
get_url:
url="{{elasticsearch_url}}"
dest=/tmp/elasticsearch.deb
- name: Install elasticsearch
apt: deb=/tmp/elasticsearch.deb
- name: Install python3.4 pre-requisits
shell: pip3 install -r sentimeter-ansible/requirements.txt
- name: Add user Ubuntu to group www-data
user: name=ubuntu groups=www-data append=yes
- name: delete nginx default.conf
file: path="{{nginx_default}}" state=absent
- name: copy nginx config file
template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf
- name: create project directory
file: path=/var/www state=directory mode=0755 owner=www-data group=www-data