-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
129 lines (103 loc) · 4.09 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
---
- hosts: all
gather_facts: false
vars:
project_name: fcs
dbname: fcs
dbuser: fcs
dbpassword: fcs
handlers:
- name: restart redis-server
action: service name=redis-server state=restarted
sudo: yes
tasks:
- name: ensure apt cache is up to date
action: apt update_cache=yes
sudo: yes
- name: install system packages
action: apt pkg={{ item }} state=present
sudo: yes
with_items:
- libpq-dev
- python-dev
- python-psycopg2
- python-pip
- python-virtualenv
- git
- vim
- python-software-properties
- libxml2-dev
- libxslt1-dev
- python-jpype
- default-jre-headless
- libdb4.8
- libdb4.8-dev
- make
- g++
- wget
- unzip
- name: add apt repositories - redis
command: apt-add-repository -y ppa:rwky/redis
sudo: yes
- name: add apt repository - oracle java
command: add-apt-repository -y ppa:webupd8team/java
sudo: yes
- name: neo4j repo key
command: /bin/sh -c 'wget -O - http://debian.neo4j.org/neotechnology.gpg.key | apt-key add -'
sudo: yes
- name: add neo4j repo
command: /bin/sh -c "/bin/echo 'deb http://debian.neo4j.org/repo stable/' > /etc/apt/sources.list.d/neo4j.list"
sudo: yes
- name: update apt-get
command: apt-get update
sudo: yes
- name: install redis
command: apt-get install redis-server
sudo: yes
- name: confirm oracle licence
command: /bin/sh -c '/bin/echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections'
sudo: yes
- name: install oracle java
command: apt-get install -y oracle-java7-installer
sudo: yes
- name: conf oracle java
command: apt-get install oracle-java7-set-default
sudo: yes
- name: install neo4j
command: apt-get install -y neo4j
sudo: yes
- name: configure redis
action: copy src=redis.conf dest=/etc/redis/7897.conf
sudo: yes
- name: ensure redis-server is running
action: service name=redis-server state=started
sudo: yes
- name: ensure neo4j-service is running
action: service name=neo4j-service state=started
sudo: yes
- name: creating virtualenv
action: command virtualenv /home/vagrant/{{ project_name }} creates=/home/vagrant/{{ project_name }}/bin/activate
- name: get berkeley db & JPype
command: /bin/sh /vagrant/setup.sh virtualenv=/home/vagrant/{{ project_name }}
environment:
JAVA_HOME: /usr/lib/jvm/java-7-oracle/
sudo: yes
- action: lineinfile dest=/home/vagrant/.bashrc regexp="^alias e=" line="alias e='. /home/vagrant/{{ project_name }}/bin/activate && cd /vagrant && export DJANGO_SETTINGS_MODULE={{ project_name }}.settings_dev'" state=present insertafter=EOF
- name: upgrading pip
action: pip name=pip virtualenv=/home/vagrant/{{ project_name }} state=latest
- name: installing python packages to virtualenv
action: pip virtualenv=/home/vagrant/{{ project_name }} requirements=/vagrant/requirements.txt extra_args='--no-use-wheel'
environment:
BERKELEYDB_DIR: /usr/local/BerkeleyDB.4.8
BERKELEYDB_LIBDIR: /usr/local/BerkeleyDB.4.8/lib
BERKELEYDB_INCDIR: /usr/local/BerkeleyDB.4.8/include
sudo: yes
- name: django syncdb
action: django_manage command=syncdb app_path=/vagrant/{{ project_name }}/
settings={{ project_name }}.settings_dev virtualenv=/home/vagrant/{{ project_name }}
- name: django migrate
action: django_manage command=migrate app_path=/vagrant/{{ project_name }}/
settings={{ project_name }}.settings_dev virtualenv=/home/vagrant/{{ project_name }}
- name: userena check permissions
action: django_manage command=check_permissions app_path=/vagrant/{{ project_name }}/
settings={{ project_name }}.settings_dev virtualenv=/home/vagrant/{{ project_name }}