|
2 | 2 | execute "apt-get upgrade -y"
|
3 | 3 |
|
4 | 4 | package [
|
| 5 | + "autoconf", |
| 6 | + "bison", |
5 | 7 | "build-essential",
|
6 | 8 | "curl",
|
7 | 9 | "git-core",
|
| 10 | + "libapr1", |
| 11 | + "libaprutil1", |
8 | 12 | "libcurl4-openssl-dev",
|
9 | 13 | "libffi-dev",
|
| 14 | + "libgmp3-dev", |
| 15 | + "libpcap-dev", |
| 16 | + "libpq-dev", |
10 | 17 | "libreadline-dev",
|
| 18 | + "libreadline6-dev", |
11 | 19 | "libsqlite3-dev",
|
12 | 20 | "libssl-dev",
|
| 21 | + "libsvn1", |
| 22 | + "libtool", |
| 23 | + "libxml2", |
13 | 24 | "libxml2-dev",
|
| 25 | + "libxslt-dev", |
14 | 26 | "libxslt1-dev",
|
15 | 27 | "libyaml-dev",
|
| 28 | + "locate", |
| 29 | + "ncurses-dev", |
| 30 | + "openssl", |
| 31 | + "postgresql", |
| 32 | + "postgresql-contrib", |
16 | 33 | "python-software-properties",
|
17 | 34 | "sqlite3",
|
| 35 | + "vim", |
| 36 | + "wget", |
| 37 | + "xsel", |
| 38 | + "zlib1g", |
18 | 39 | "zlib1g-dev",
|
19 | 40 | ]
|
20 | 41 |
|
21 |
| -bash "install postgres" do |
22 |
| - user "root" |
23 |
| - not_if { ::File.exist?("/etc/apt/sources.list.d/pgdg.list") } |
24 |
| - code <<-SCRIPT |
25 |
| - echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list |
26 |
| - wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc \ |
27 |
| - | apt-key add - |
28 |
| - apt-get update -y |
29 |
| - apt-get install -y postgresql-9.4 libpq-dev \ |
30 |
| - postgresql-contrib-9.4 postgresql-client-common |
31 |
| - SCRIPT |
32 |
| -end |
33 |
| - |
34 | 42 | sql = "SELECT 1 FROM pg_roles WHERE rolname='vagrant'"
|
35 | 43 | create_user = "createuser -s -e -w vagrant"
|
36 | 44 | execute "psql postgres -tAc \"#{sql}\" | grep -q 1 || #{create_user}" do
|
|
43 | 51 | not_if { "psql postgres -tAc \"#{sql}\" | grep -q 1" }
|
44 | 52 | end
|
45 | 53 |
|
| 54 | +file "/vagrant/.msf4/database.yml" do |
| 55 | + content <<-EOH |
| 56 | +# Development Database |
| 57 | +development: &pgsql |
| 58 | + adapter: postgresql |
| 59 | + database: msf_dev_db |
| 60 | + username: vagrant |
| 61 | + host: localhost |
| 62 | + port: 5432 |
| 63 | + pool: 5 |
| 64 | + timeout: 5 |
| 65 | +
|
| 66 | +# Production database -- same as dev |
| 67 | +production: &production |
| 68 | + <<: *pgsql |
| 69 | +
|
| 70 | +# Test database -- not the same, since it gets dropped all the time |
| 71 | +test: |
| 72 | + <<: *pgsql |
| 73 | + database: msf_test_db |
| 74 | +EOH |
| 75 | +end |
| 76 | + |
| 77 | +["postgresql"].each do |service_name| |
| 78 | + service service_name do |
| 79 | + action [:enable, :start] |
| 80 | + end |
| 81 | +end |
| 82 | + |
46 | 83 | git "/usr/local/rbenv" do
|
47 | 84 | repository "https://github.com/sstephenson/rbenv.git"
|
48 | 85 | end
|
|
78 | 115 | gem install bundler --no-ri --no-rdoc
|
79 | 116 | EOH
|
80 | 117 | end
|
81 |
| - |
82 |
| -["postgresql"].each do |service_name| |
83 |
| - service service_name do |
84 |
| - action [:enable, :start] |
85 |
| - end |
86 |
| -end |
|
0 commit comments