-
Notifications
You must be signed in to change notification settings - Fork 2
/
Cheffile
64 lines (52 loc) · 2.31 KB
/
Cheffile
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
#!/usr/bin/env ruby
#^syntax detection
# This file is a bit of a hack, an attempt to make the one-file mirage of
# app-server.json.erb work properly while not limiting you to purely
# off-the-shelf cookbooks.
#
# Cookbooks required by the deploy repo itself are specified here, usually
# with specific versions. That's to make sure that, say, the NGinX and MySQL
# cookbooks are well-tested with the code to make them work. But if you mess
# with app-server.json.erb to add more cookbooks, by default that should work
# too.
#
# However, "works by default" has some limits. If you include cookbooks in the
# run list, we'll try to load them from the site(s) below -- mostly the
# OpsCode community site -- by name, with no further information. If you want
# to load a non-standard site or cookbook, or load a cookbook from a git repo,
# or limit it to specific versions, you're going to need to edit this file as
# you normally would with a Cheffile or Berksfile.
# Note to Berkshelf users: this is for librarian-chef, which is basically the
# same thing as Berkshelf and works basically the same way. Yup, it's Bundler
# for Chef.
# Read in node files
require File.join(File.dirname(__FILE__), "config", "madscience_config.rb")
nodes_json = get_json_by_vm
# Now, get the cookbooks from the run list
run_list = nodes_json.values.flat_map { |node| node["run_list"] }
run_list_cookbooks = run_list.map { |s| s.split("::", 2)[0] }.uniq
# These two are supplied by the deploy repo itself
run_list_cookbooks -= [ "basic_config", "rails_server" ]
# These are given by specific versions down below. If you remove
# those lines, you have to remove them here too!
run_list_cookbooks -= ["runit", "nginx", "mysql", "database", "rvm"]
site 'http://community.opscode.com/api/v1'
# You can give specific sources and versions down here. It's safer to,
# but we want this to work regardless.
cookbook 'apt', '2.4.0'
cookbook 'runit', '1.5.10'
cookbook 'nginx', '2.7.4'
cookbook 'mysql', '5.3.6'
cookbook 'database', '2.3.1'
#cookbook 'postgresql', '3.4.2'
cookbook 'rvm', '0.9.2'
run_list_cookbooks.each do |cb|
cookbook cb
end
# cookbook 'chef-client'
# cookbook 'apache2', '>= 1.0.0'
# cookbook 'rvm',
# :git => 'https://github.com/fnichol/chef-rvm'
# cookbook 'postgresql',
# :git => 'https://github.com/findsyou/cookbooks',
# :ref => 'postgresql-improvements'