-
Notifications
You must be signed in to change notification settings - Fork 1
/
otindex.yml
78 lines (62 loc) · 1.73 KB
/
otindex.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
---
- hosts: all
gather_facts: False
# start by installing required packages (note that postgresql packages
# installed separately in postgresql role and apache packages installed
# in apache role)
pre_tasks:
# - name: Update and upgrade apt packages
# become: true
# apt:
# upgrade: yes
# update_cache: yes
# cache_valid_time: 86400 #One day
- name: Install packages
become: true
apt: name={{ item }} state=present
with_items:
- virtualenv
- libpq-dev
- git-core
- build-essential
- python-psycopg2
- python-dev
- name: Add user "opentree"
user:
name: opentree
shell: /bin/bash # Defaults to /bin/bash
state: present
become: true
# This is only needed for otindex, it's up here so that it fails faster
- name: Install pyscopg venv
pip:
virtualenv: "{{ install_dir }}/../venv"
virtualenv_python: python3
name: psycopg2
become: yes
become_user: opentree
- name: Create log file dir
file:
path: "{{ otindex_logfile_dir }}"
state: directory
force: no
mode: 0775
group: opentree
owner: opentree
become: yes
roles:
- postgresql
- peyotl
- otindex
- otdata
- {role: 'apache', tags: 'apache'}
# set this at play level because used in multiple roles: peyotl and otindex
# This was not working as hoped...
# environment:
# PEYOTL_CONFIG_FILE: "{{ peyotl_config_location }}/config"
handlers:
- name: restart apache
become: true
service: name=apache2 state=restarted
- name: restart postgresql
service: name=postgresql state=restarted