-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrails.yml
55 lines (40 loc) · 1.57 KB
/
rails.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
---
- hosts: rails
tasks:
- name: ensure deploy user exists
user: name='deploy'
- name: Make sure /var/u/apps exists
file: path=/var/u/apps owner=deploy group=deploy state=directory
- name: ensure postgresql dev is installed
apt: pkg=postgresql-server-dev-all state=installed
- name: ensure nokogiri pre-requisites are installed
apt: pkg=libxml2-dev,libxml2,libxslt1-dev,libxslt1.1 state=installed
- name: ensure curl is available
apt: pkg=curl state=present
- apt: pkg=ruby-full,bundler state=latest
- file: path=/var/u/apps/metadata/releases group=deploy owner=deploy state=directory
- file: path=/var/u/apps/metadata/shared/{{item.dir }} group=deploy owner=deploy state=directory
with_items:
- { dir: "config"}
- { dir: "pids" }
- { dir: "log" }
- { dir: "system" }
- { dir: "assets" }
- { dir: "bundle" }
- { dir: "cached-copy" }
- copy: src=private/config/{{item.file }} dest=/var/u/apps/metadata/shared/config/{{item.file }} owner=deploy group=deploy mode=600
with_items:
- { file: "database.yml" }
- { file: "s3.yml" }
- { file: "secret_token.rb" }
- { file: "site_keys.rb" }
- { file: "unicorn.rb" }
- apt: pkg=nginx-full state=latest
- copy: src="nginx/metadata.conf" dest="/etc/nginx/sites-available/metadata.conf"
- file: src=/etc/nginx/sites-available/metadata.conf dest=/etc/nginx/sites-enabled/metadata.conf state=link
notify:
restart nginx
- ufw: rule=allow port=4060
handlers:
- name: restart nginx
service: name=nginx state=restarted