-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patheasylodge_stack.rb
66 lines (58 loc) · 1.61 KB
/
easylodge_stack.rb
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
# Configures a blank instance with everything we need to get a stack installed.
#
# This dep must be run as root.
#
# During this dep you will be asked for your SSH pub key to allow authentication
# as the user you specify during installation e.g deploy
dep('easylodge deployable') {
setup {
unmeetable! "This dep has to be run as root." unless shell('whoami') == 'root'
}
requires [
'benhoskings:system',
'testpilot:ruby dependencies',
'ivanvanderbyl:ruby.src'.with('1.9.2','p320'),
'benhoskings:user setup for provisioning',
'testpilot:core dependencies',
'testpilot:build essential installed',
'testpilot:nodejs.src',
'benhoskings:core software',
'benhoskings:passwordless sudo'
]
}
dep('easylodge stack') {
setup {
unmeetable! "This dep cannot be run as root." if shell('whoami') == 'root'
}
requires 'testpilot:core dependencies',
'benhoskings:imagemagick.managed',
'benhoskings:secured ssh logins',
'user can write to usr local',
'libmysqlclient-dev.managed',
'mysql-client.managed',
'ivanvanderbyl:running.nginx',
'postgresql.managed',
'testpilot:sphinx installed'.with('0.9.9'),
'vhost enabled.nginx',
'prince xml installed',
'bundler.gem'
}
dep('libmysqlclient-dev.managed'){
provides []
}
dep('mysql-client.managed') {
provides ['mysql']
installs 'mysql-client'
}
dep('user can write to usr local') {
def user
shell 'whoami'
end
met? {
shell?("touch /usr/local/lib/touch-this") &&
shell?('rm /usr/local/lib/touch-this')
}
meet {
shell "chown -R #{user}:#{user} /usr/local/", :sudo => true
}
}