-
Notifications
You must be signed in to change notification settings - Fork 13
/
playbook.yml
89 lines (76 loc) · 1.72 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
---
- hosts: localhost
connection: local
tasks:
- name: Manages user
become: yes
user:
name: "{{ item.name }}"
system: yes
with_items:
- { name: 'opal_deploy', group: 'opal', uid: 999}
- { name: 'opal', group: 'opal', uid: 998}
- name: Ensure apt cache is up to date
become: yes
apt:
update_cache: yes
- name: Upgrade all packages to the latest version
become: yes
apt:
upgrade: 'yes'
update_cache: 'yes'
- name: Install required system packages
become: yes
apt:
name: "{{ packages }}"
vars:
packages:
- postgresql-client
- postgresql-contrib
- libpq-dev
- build-essential
- pkg-config
- libxml2-dev
- libxmlsec1-dev
- libxmlsec1-openssl
- apache2
- apache2-dev
- name: Clean apt cache
become: yes
apt:
autoclean: yes
- name: Install pip
pip:
name: pip
state: latest
- name: Install required Python packages
pip:
requirements: /usr/src/app/requirements.txt
# - name: Install mod-wsgi
# pip:
# name: mod-wsgi
- name: chmod files and directories
file:
path: /usr/src/app/
recurse: yes
mode: '0750'
owner: opal_deploy
group: opal
- name: chmod startup script
file:
path: /usr/src/app/startup.sh
mode: '0555'
owner: opal_deploy
group: opal
- name: Create directories
file:
path: "{{ item }}"
state: directory
mode: '0770'
owner: opal
group: opal
loop:
- /usr/src/app/static
- /usr/src/app/media
- /usr/src/logs
- /usr/src/data