elzar 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. data/.chef/knife.rb +3 -0
  2. data/.gitignore +1 -0
  3. data/.rvmrc +1 -0
  4. data/Gemfile +11 -0
  5. data/Gemfile.lock +96 -0
  6. data/README.md +42 -0
  7. data/Rakefile +1 -0
  8. data/Vagrantfile +16 -0
  9. data/cookbooks/.gitkeep +0 -0
  10. data/cookbooks/apt/README.md +122 -0
  11. data/cookbooks/apt/files/default/apt-cacher +9 -0
  12. data/cookbooks/apt/files/default/apt-cacher.conf +144 -0
  13. data/cookbooks/apt/files/default/apt-proxy-v2.conf +50 -0
  14. data/cookbooks/apt/metadata.rb +13 -0
  15. data/cookbooks/apt/providers/repository.rb +73 -0
  16. data/cookbooks/apt/recipes/cacher-client.rb +44 -0
  17. data/cookbooks/apt/recipes/cacher.rb +45 -0
  18. data/cookbooks/apt/recipes/default.rb +50 -0
  19. data/cookbooks/apt/resources/repository.rb +30 -0
  20. data/cookbooks/build-essential/README.md +24 -0
  21. data/cookbooks/build-essential/metadata.rb +10 -0
  22. data/cookbooks/build-essential/recipes/default.rb +45 -0
  23. data/cookbooks/database/README.md +403 -0
  24. data/cookbooks/database/libraries/provider_database_mysql.rb +97 -0
  25. data/cookbooks/database/libraries/provider_database_mysql_user.rb +76 -0
  26. data/cookbooks/database/libraries/provider_database_postgresql.rb +126 -0
  27. data/cookbooks/database/libraries/provider_database_postgresql_user.rb +78 -0
  28. data/cookbooks/database/libraries/provider_database_sql_server.rb +109 -0
  29. data/cookbooks/database/libraries/provider_database_sql_server_user.rb +106 -0
  30. data/cookbooks/database/libraries/resource_database.rb +111 -0
  31. data/cookbooks/database/libraries/resource_database_user.rb +90 -0
  32. data/cookbooks/database/libraries/resource_mysql_database.rb +34 -0
  33. data/cookbooks/database/libraries/resource_mysql_database_user.rb +34 -0
  34. data/cookbooks/database/libraries/resource_postgresql_database.rb +35 -0
  35. data/cookbooks/database/libraries/resource_postgresql_database_user.rb +35 -0
  36. data/cookbooks/database/libraries/resource_sql_server_database.rb +34 -0
  37. data/cookbooks/database/libraries/resource_sql_server_database_user.rb +34 -0
  38. data/cookbooks/database/metadata.rb +21 -0
  39. data/cookbooks/database/recipes/default.rb +20 -0
  40. data/cookbooks/database/recipes/ebs_backup.rb +89 -0
  41. data/cookbooks/database/recipes/ebs_volume.rb +196 -0
  42. data/cookbooks/database/recipes/master.rb +78 -0
  43. data/cookbooks/database/recipes/snapshot.rb +62 -0
  44. data/cookbooks/database/templates/default/app_grants.sql.erb +8 -0
  45. data/cookbooks/database/templates/default/aws_config.erb +3 -0
  46. data/cookbooks/database/templates/default/chef-solo-database-snapshot.cron.erb +10 -0
  47. data/cookbooks/database/templates/default/chef-solo-database-snapshot.json.erb +1 -0
  48. data/cookbooks/database/templates/default/chef-solo-database-snapshot.rb.erb +6 -0
  49. data/cookbooks/database/templates/default/ebs-backup-cron.erb +2 -0
  50. data/cookbooks/database/templates/default/ebs-db-backup.sh.erb +8 -0
  51. data/cookbooks/database/templates/default/ebs-db-restore.sh.erb +10 -0
  52. data/cookbooks/database/templates/default/s3cfg.erb +27 -0
  53. data/cookbooks/mysql/README.md +148 -0
  54. data/cookbooks/mysql/attributes/server.rb +68 -0
  55. data/cookbooks/mysql/libraries/database.rb +19 -0
  56. data/cookbooks/mysql/libraries/helpers.rb +33 -0
  57. data/cookbooks/mysql/metadata.rb +90 -0
  58. data/cookbooks/mysql/recipes/client.rb +51 -0
  59. data/cookbooks/mysql/recipes/default.rb +20 -0
  60. data/cookbooks/mysql/recipes/server.rb +133 -0
  61. data/cookbooks/mysql/recipes/server_ec2.rb +49 -0
  62. data/cookbooks/mysql/templates/default/debian.cnf.erb +12 -0
  63. data/cookbooks/mysql/templates/default/grants.sql.erb +15 -0
  64. data/cookbooks/mysql/templates/default/my.cnf.erb +176 -0
  65. data/cookbooks/mysql/templates/default/mysql-server.seed.erb +10 -0
  66. data/cookbooks/mysql/templates/default/port_mysql.erb +3 -0
  67. data/cookbooks/openssl/README.md +37 -0
  68. data/cookbooks/openssl/libraries/secure_password.rb +37 -0
  69. data/cookbooks/openssl/metadata.rb +8 -0
  70. data/cookbooks/openssl/recipes/default.rb +19 -0
  71. data/cookbooks/passenger_enterprise/README.rdoc +8 -0
  72. data/cookbooks/passenger_enterprise/attributes/default.rb +28 -0
  73. data/cookbooks/passenger_enterprise/cc.gemspec +36 -0
  74. data/cookbooks/passenger_enterprise/metadata.json +44 -0
  75. data/cookbooks/passenger_enterprise/metadata.rb +16 -0
  76. data/cookbooks/passenger_enterprise/recipes/apache2.rb +54 -0
  77. data/cookbooks/passenger_enterprise/recipes/default.rb +30 -0
  78. data/cookbooks/passenger_enterprise/recipes/nginx.rb +50 -0
  79. data/cookbooks/passenger_enterprise/templates/default/passenger.conf.erb +2 -0
  80. data/cookbooks/passenger_enterprise/templates/default/passenger.load.erb +1 -0
  81. data/cookbooks/passenger_enterprise/templates/default/passenger_nginx.conf.erb +2 -0
  82. data/cookbooks/ruby_enterprise/README.rdoc +55 -0
  83. data/cookbooks/ruby_enterprise/attributes/default.rb +33 -0
  84. data/cookbooks/ruby_enterprise/cc.gemspec +36 -0
  85. data/cookbooks/ruby_enterprise/definitions/ree_gem.rb +28 -0
  86. data/cookbooks/ruby_enterprise/metadata.json +45 -0
  87. data/cookbooks/ruby_enterprise/metadata.rb +13 -0
  88. data/cookbooks/ruby_enterprise/recipes/default.rb +67 -0
  89. data/data_bags/deploy/authorized_keys.json +9 -0
  90. data/dna.json +25 -0
  91. data/elzar.gemspec +22 -0
  92. data/lib/elzar.rb +21 -0
  93. data/lib/elzar/assistant.rb +77 -0
  94. data/lib/elzar/chef_dna.rb +48 -0
  95. data/lib/elzar/template.rb +24 -0
  96. data/lib/elzar/templates/Gemfile +11 -0
  97. data/lib/elzar/templates/Vagrantfile.erb +16 -0
  98. data/lib/elzar/templates/dna.json +25 -0
  99. data/lib/elzar/templates/solo.rb.erb +6 -0
  100. data/lib/elzar/version.rb +3 -0
  101. data/roles/enterprise_appstack.rb +4 -0
  102. data/roles/plumbing.rb +11 -0
  103. data/roles/postgres_database.rb +4 -0
  104. data/roles/ruby_appstack.rb +4 -0
  105. data/script/install_cookbook +6 -0
  106. data/script/new_cookbook +5 -0
  107. data/site-cookbooks/.gitkeep +0 -0
  108. data/site-cookbooks/curl/README.md +17 -0
  109. data/site-cookbooks/curl/metadata.rb +6 -0
  110. data/site-cookbooks/curl/recipes/default.rb +11 -0
  111. data/site-cookbooks/nginx/CHANGELOG.md +11 -0
  112. data/site-cookbooks/nginx/CONTRIBUTING +29 -0
  113. data/site-cookbooks/nginx/LICENSE +201 -0
  114. data/site-cookbooks/nginx/README.md +76 -0
  115. data/site-cookbooks/nginx/attributes/default.rb +65 -0
  116. data/site-cookbooks/nginx/definitions/nginx_site.rb +35 -0
  117. data/site-cookbooks/nginx/files/default/mime.types +73 -0
  118. data/site-cookbooks/nginx/metadata.rb +89 -0
  119. data/site-cookbooks/nginx/recipes/default.rb +57 -0
  120. data/site-cookbooks/nginx/recipes/source.rb +126 -0
  121. data/site-cookbooks/nginx/templates/default/default-site.erb +11 -0
  122. data/site-cookbooks/nginx/templates/default/nginx.conf.erb +42 -0
  123. data/site-cookbooks/nginx/templates/default/nginx.init.erb +91 -0
  124. data/site-cookbooks/nginx/templates/default/nxdissite.erb +29 -0
  125. data/site-cookbooks/nginx/templates/default/nxensite.erb +38 -0
  126. data/site-cookbooks/passenger/README.md +12 -0
  127. data/site-cookbooks/passenger/attributes/default.rb +3 -0
  128. data/site-cookbooks/passenger/metadata.rb +6 -0
  129. data/site-cookbooks/passenger/recipes/default.rb +39 -0
  130. data/site-cookbooks/passenger/templates/default/passenger_nginx.conf.erb +2 -0
  131. data/site-cookbooks/postgresql/README.md +150 -0
  132. data/site-cookbooks/postgresql/attributes/default.rb +72 -0
  133. data/site-cookbooks/postgresql/metadata.rb +21 -0
  134. data/site-cookbooks/postgresql/recipes/client.rb +40 -0
  135. data/site-cookbooks/postgresql/recipes/default.rb +20 -0
  136. data/site-cookbooks/postgresql/recipes/server.rb +74 -0
  137. data/site-cookbooks/postgresql/recipes/server_debian.rb +62 -0
  138. data/site-cookbooks/postgresql/recipes/server_redhat.rb +82 -0
  139. data/site-cookbooks/postgresql/templates/default/debian.postgresql.conf.erb +499 -0
  140. data/site-cookbooks/postgresql/templates/default/pg_hba.conf.erb +83 -0
  141. data/site-cookbooks/postgresql/templates/default/redhat.postgresql.conf.erb +501 -0
  142. data/site-cookbooks/rails_app/README.md +15 -0
  143. data/site-cookbooks/rails_app/attributes/default.rb +2 -0
  144. data/site-cookbooks/rails_app/files/default/sudoers +26 -0
  145. data/site-cookbooks/rails_app/metadata.rb +6 -0
  146. data/site-cookbooks/rails_app/recipes/default.rb +143 -0
  147. data/site-cookbooks/rails_app/recipes/system_libraries.rb +12 -0
  148. data/site-cookbooks/rails_app/templates/default/pg_hba.conf.erb +84 -0
  149. data/site-cookbooks/rails_app/templates/default/rails_app_nginx.erb +10 -0
  150. data/site-cookbooks/ruby/README.md +12 -0
  151. data/site-cookbooks/ruby/attributes/default.rb +6 -0
  152. data/site-cookbooks/ruby/metadata.rb +6 -0
  153. data/site-cookbooks/ruby/recipes/default.rb +54 -0
  154. data/solo.rb +7 -0
  155. data/upgrade-chef.sh +8 -0
  156. metadata +272 -0
@@ -0,0 +1,10 @@
1
+ mysql-server-5.0 mysql-server/root_password_again select <%= node['mysql']['server_root_password'] %>
2
+ mysql-server-5.0 mysql-server/root_password select <%= node['mysql']['server_root_password'] %>
3
+ mysql-server-5.0 mysql-server-5.0/really_downgrade boolean false
4
+ mysql-server-5.0 mysql-server-5.0/need_sarge_compat boolean false
5
+ mysql-server-5.0 mysql-server-5.0/start_on_boot boolean true
6
+ mysql-server-5.0 mysql-server/error_setting_password boolean false
7
+ mysql-server-5.0 mysql-server-5.0/nis_warning note
8
+ mysql-server-5.0 mysql-server-5.0/postrm_remove_databases boolean false
9
+ mysql-server-5.0 mysql-server/password_mismatch boolean false
10
+ mysql-server-5.0 mysql-server-5.0/need_sarge_compat_done boolean true
@@ -0,0 +1,3 @@
1
+ # MySQL
2
+ -A FWR -p tcp -m tcp --dport 3306 -j ACCEPT
3
+ -A FWR -p udp -m udp --dport 3306 -j ACCEPT
@@ -0,0 +1,37 @@
1
+ Description
2
+ ====
3
+
4
+ Provide a library method to generate secure random passwords in recipes.
5
+
6
+ Requirements
7
+ ====
8
+
9
+ Works on any platform with OpenSSL Ruby bindings installed, which are a requirement for Chef anyway.
10
+
11
+ Usage
12
+ ====
13
+
14
+ Most often this will be used to generate a secure password for an attribute.
15
+
16
+ include Opscode::OpenSSL::Password
17
+
18
+ set_unless[:my_password] = secure_password
19
+
20
+ License and Author
21
+ ====
22
+
23
+ Author:: Joshua Timberman (<joshua@opscode.com>)
24
+
25
+ Copyright:: 2009-2011, Opscode, Inc
26
+
27
+ Licensed under the Apache License, Version 2.0 (the "License");
28
+ you may not use this file except in compliance with the License.
29
+ You may obtain a copy of the License at
30
+
31
+ http://www.apache.org/licenses/LICENSE-2.0
32
+
33
+ Unless required by applicable law or agreed to in writing, software
34
+ distributed under the License is distributed on an "AS IS" BASIS,
35
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36
+ See the License for the specific language governing permissions and
37
+ limitations under the License.
@@ -0,0 +1,37 @@
1
+ #
2
+ # Cookbook Name:: openssl
3
+ # Library:: secure_password
4
+ # Author:: Joshua Timberman <joshua@opscode.com>
5
+ #
6
+ # Copyright 2009, Opscode, Inc.
7
+ #
8
+ # Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+ #
20
+
21
+ require 'openssl'
22
+
23
+ module Opscode
24
+ module OpenSSL
25
+ module Password
26
+ def secure_password
27
+ pw = String.new
28
+
29
+ while pw.length < 20
30
+ pw << ::OpenSSL::Random.random_bytes(1).gsub(/\W/, '')
31
+ end
32
+
33
+ pw
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,8 @@
1
+ maintainer "Opscode, Inc."
2
+ maintainer_email "cookbooks@opscode.com"
3
+ license "Apache 2.0"
4
+ description "Provides a library with a method for generating secure random passwords."
5
+ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
6
+ version "1.0.0"
7
+
8
+ recipe "openssl", "Empty, this cookbook provides a library, see README.md"
@@ -0,0 +1,19 @@
1
+ #
2
+ # Cookbook Name:: openssl
3
+ # Recipe:: default
4
+ #
5
+ # Copyright 2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
@@ -0,0 +1,8 @@
1
+ = DESCRIPTION:
2
+
3
+ = REQUIREMENTS:
4
+
5
+ = ATTRIBUTES:
6
+
7
+ = USAGE:
8
+
@@ -0,0 +1,28 @@
1
+ #
2
+ # Cookbook Name:: passenger_enterprise
3
+ # Based on passenger_apache2
4
+ # attributes:: passenger_enterprise
5
+ #
6
+ # Author:: Joshua Timberman (<joshua@opscode.com>)
7
+ # Author:: Joshua Sierles (<joshua@37signals.com>)
8
+ # Author:: Michael Hale (<mikehale@gmail.com>)
9
+ #
10
+ # Copyright:: 2009, Opscode, Inc
11
+ # Copyright:: 2009, 37signals
12
+ # Coprighty:: 2009, Michael Hale
13
+ #
14
+ # Licensed under the Apache License, Version 2.0 (the "License");
15
+ # you may not use this file except in compliance with the License.
16
+ # You may obtain a copy of the License at
17
+ #
18
+ # http://www.apache.org/licenses/LICENSE-2.0
19
+ #
20
+ # Unless required by applicable law or agreed to in writing, software
21
+ # distributed under the License is distributed on an "AS IS" BASIS,
22
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
+ # See the License for the specific language governing permissions and
24
+ # limitations under the License.
25
+ #
26
+ default[:passenger_enterprise][:version] = "2.2.15"
27
+ default[:passenger_enterprise][:root_path] = "/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-#{passenger_enterprise[:version]}"
28
+ default[:passenger_enterprise][:module_path] = "#{passenger_enterprise[:root_path]}/ext/apache2/mod_passenger.so"
@@ -0,0 +1,36 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../',__FILE__)
3
+ lib_up = File.expand_path('../../', __FILE__)
4
+ $:.unshift lib unless $:.include?(lib)
5
+ $:.unshift lib_up unless $:.include?(lib_up)
6
+ require 'json'
7
+
8
+ ENV['GEM_PATH']=ENV['BUNDLE_INSTALL_PATH'] if ENV['BUNDLE_INSTALL_PATH']
9
+ ENV['GEM_HOME']=ENV['BUNDLE_INSTALL_PATH'] if ENV['BUNDLE_INSTALL_PATH']
10
+
11
+ name = File.split(lib)[-1]||""
12
+ raise ArgumentError, '', caller if name.empty?
13
+ @name=name
14
+
15
+ Gem.use_paths(ENV['BUNDLE_INSTALL_PATH'],[]) if ENV['BUNDLE_INSTALL_PATH']
16
+
17
+ Gem::Specification.new do |s|
18
+
19
+ md = JSON.parse(File.read(File.expand_path('../metadata.json', __FILE__)))
20
+
21
+ # Required attributes (gem build fails without these)
22
+ s.name = @name
23
+ s.version = md['version'] && !md['version'].empty? ? md['version'] : '0'
24
+ s.files = Dir.glob('**/*') #.map{|f| File.expand_path(f)}
25
+ s.summary = md['description'] ? md['description'] : "The Chef cookbook for #{s.name}"
26
+
27
+ # Optional attributes (gem build warning raised without these)
28
+ s.author = md['maintainer'] ? md['maintainer'] : 'No acknowledged maintainer'
29
+ s.description = md['long_description'] ? md['long_description'] : s.summary
30
+ s.email = md['maintainer_email'] ? md['maintainer_email'] : 'No acknowledged maintainer email'
31
+ s.homepage = 'http://www.opscode.com'
32
+ md['dependencies'].each { |k,v| s.add_dependency(k,v) };
33
+
34
+ s.post_install_message = "Installed Chef Cookbook #{s.name}\n#{s.description}"
35
+
36
+ end
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "passenger_enterprise",
3
+ "description": "Installs and configures Passenger under Ruby Enterprise Edition with Apache",
4
+ "long_description": "= DESCRIPTION:\n\n= REQUIREMENTS:\n\n= ATTRIBUTES:\n\n= USAGE:\n\n",
5
+ "maintainer": "Opscode, Inc.",
6
+ "maintainer_email": "cookbooks@opscode.com",
7
+ "license": "Apache 2.0",
8
+ "platforms": {
9
+ "ubuntu": [
10
+
11
+ ]
12
+ },
13
+ "dependencies": {
14
+ "ruby_enterprise": [
15
+
16
+ ],
17
+ "nginx": [
18
+
19
+ ],
20
+ "apache2": [
21
+
22
+ ]
23
+ },
24
+ "recommendations": {
25
+ },
26
+ "suggestions": {
27
+ },
28
+ "conflicting": {
29
+ },
30
+ "providing": {
31
+ },
32
+ "replacing": {
33
+ },
34
+ "attributes": {
35
+ },
36
+ "groupings": {
37
+ },
38
+ "recipes": {
39
+ "passenger_enterprise": "Installs Passenger gem with Ruby Enterprise Edition",
40
+ "passenger_enterprise::apache2": "Enables Apache module configuration for passenger under Ruby Enterprise Edition",
41
+ "passenger_enterprise::nginx": "Installs Passenger gem w/ REE, and recompiles support into Nginx"
42
+ },
43
+ "version": "0.99.0"
44
+ }
@@ -0,0 +1,16 @@
1
+ maintainer "Opscode, Inc."
2
+ maintainer_email "cookbooks@opscode.com"
3
+ license "Apache 2.0"
4
+ description "Installs and configures Passenger under Ruby Enterprise Edition with Apache"
5
+ long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
6
+ version "0.99.0"
7
+
8
+ recipe "passenger_enterprise", "Installs Passenger gem with Ruby Enterprise Edition"
9
+ recipe "passenger_enterprise::apache2", "Enables Apache module configuration for passenger under Ruby Enterprise Edition"
10
+ recipe "passenger_enterprise::nginx", "Installs Passenger gem w/ REE, and recompiles support into Nginx"
11
+
12
+ %w{ ruby_enterprise nginx apache2 }.each do |cb|
13
+ depends cb
14
+ end
15
+
16
+ supports "ubuntu"
@@ -0,0 +1,54 @@
1
+ #
2
+ # Cookbook Name:: passenger_enterprise
3
+ # Based on passenger_apache2
4
+ # Recipe:: apache2
5
+ #
6
+ # Author:: Joshua Timberman (<joshua@opscode.com>)
7
+ # Author:: Joshua Sierles (<joshua@37signals.com>)
8
+ # Author:: Michael Hale (<mikehale@gmail.com>)
9
+ #
10
+ # Copyright:: 2009, Opscode, Inc
11
+ # Copyright:: 2009, 37signals
12
+ # Coprighty:: 2009, Michael Hale
13
+ #
14
+ # Licensed under the Apache License, Version 2.0 (the "License");
15
+ # you may not use this file except in compliance with the License.
16
+ # You may obtain a copy of the License at
17
+ #
18
+ # http://www.apache.org/licenses/LICENSE-2.0
19
+ #
20
+ # Unless required by applicable law or agreed to in writing, software
21
+ # distributed under the License is distributed on an "AS IS" BASIS,
22
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
+ # See the License for the specific language governing permissions and
24
+ # limitations under the License.
25
+
26
+ include_recipe "passenger_enterprise"
27
+ include_recipe "apache2"
28
+
29
+ %w{ apache2-threaded-dev libapr1-dev libaprutil1-dev }.each do |pkg|
30
+ package pkg do
31
+ action :install
32
+ end
33
+ end
34
+
35
+ execute "passenger_apache2_module" do
36
+ command "#{node[:ruby_enterprise][:install_path]}/bin/passenger-install-apache2-module -a"
37
+ creates node[:passenger_enterprise][:module_path]
38
+ end
39
+
40
+ template "#{node[:apache][:dir]}/mods-available/passenger.load" do
41
+ source "passenger.load.erb"
42
+ owner "root"
43
+ group "root"
44
+ mode 0755
45
+ end
46
+
47
+ template "#{node[:apache][:dir]}/mods-available/passenger.conf" do
48
+ source "passenger.conf.erb"
49
+ owner "root"
50
+ group "root"
51
+ mode 0755
52
+ end
53
+
54
+ apache_module "passenger"
@@ -0,0 +1,30 @@
1
+ #
2
+ # Cookbook Name:: passenger_enterprise
3
+ # Based on passenger_apache2, adapted for nginx too.
4
+ # Recipe:: default
5
+ #
6
+ # Author:: Joshua Timberman (<joshua@opscode.com>)
7
+ # Author:: Joshua Sierles (<joshua@37signals.com>)
8
+ # Author:: Michael Hale (<mikehale@gmail.com>)
9
+ #
10
+ # Copyright:: 2009, Opscode, Inc
11
+ # Copyright:: 2009, 37signals
12
+ # Coprighty:: 2009, Michael Hale
13
+ #
14
+ # Licensed under the Apache License, Version 2.0 (the "License");
15
+ # you may not use this file except in compliance with the License.
16
+ # You may obtain a copy of the License at
17
+ #
18
+ # http://www.apache.org/licenses/LICENSE-2.0
19
+ #
20
+ # Unless required by applicable law or agreed to in writing, software
21
+ # distributed under the License is distributed on an "AS IS" BASIS,
22
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
+ # See the License for the specific language governing permissions and
24
+ # limitations under the License.
25
+
26
+ include_recipe "ruby_enterprise"
27
+
28
+ ree_gem "passenger" do
29
+ version node[:passenger_enterprise][:version]
30
+ end
@@ -0,0 +1,50 @@
1
+ #
2
+ # Cookbook Name:: passenger_enterprise
3
+ # Recipe:: nginx
4
+ #
5
+ # Author:: Joshua Timberman (<joshua@opscode.com>)
6
+ # Author:: Joshua Sierles (<joshua@37signals.com>)
7
+ # Author:: Michael Hale (<mikehale@gmail.com>)
8
+ #
9
+ # Copyright:: 2009, Opscode, Inc
10
+ # Copyright:: 2009, 37signals
11
+ # Coprighty:: 2009, Michael Hale
12
+ #
13
+ # Licensed under the Apache License, Version 2.0 (the "License");
14
+ # you may not use this file except in compliance with the License.
15
+ # You may obtain a copy of the License at
16
+ #
17
+ # http://www.apache.org/licenses/LICENSE-2.0
18
+ #
19
+ # Unless required by applicable law or agreed to in writing, software
20
+ # distributed under the License is distributed on an "AS IS" BASIS,
21
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ # See the License for the specific language governing permissions and
23
+ # limitations under the License.
24
+
25
+ include_recipe "nginx::source"
26
+ include_recipe "passenger_enterprise"
27
+
28
+ configure_flags = node[:nginx][:configure_flags].join(" ")
29
+ nginx_install = node[:nginx][:install_path]
30
+ nginx_version = node[:nginx][:version]
31
+ nginx_dir = node[:nginx][:dir]
32
+
33
+ execute "passenger_nginx_module" do
34
+ command %Q{
35
+ #{node[:ruby_enterprise][:install_path]}/bin/passenger-install-nginx-module \
36
+ --auto --prefix=#{nginx_install} \
37
+ --nginx-source-dir=#{Chef::Config[:file_cache_path]}/nginx-#{nginx_version} \
38
+ --extra-configure-flags='#{configure_flags}'
39
+ }
40
+ not_if "#{nginx_install}/sbin/nginx -V 2>&1 | grep '#{node[:ruby_enterprise][:gems_dir]}/gems/passenger-#{node[:passenger_enterprise][:version]}/ext/nginx'"
41
+ notifies :restart, resources(:service => "nginx")
42
+ end
43
+
44
+ template "#{nginx_dir}/conf.d/passenger.conf" do
45
+ source "passenger_nginx.conf.erb"
46
+ owner "root"
47
+ group "root"
48
+ mode "0644"
49
+ notifies :restart, resources(:service => "nginx")
50
+ end
@@ -0,0 +1,2 @@
1
+ PassengerRoot <%= node[:passenger_enterprise][:root_path] %>
2
+ PassengerRuby <%= node[:ruby_enterprise][:ruby_bin] %>
@@ -0,0 +1 @@
1
+ LoadModule passenger_module <%= node[:passenger_enterprise][:module_path] %>
@@ -0,0 +1,2 @@
1
+ passenger_root <%= node[:passenger_enterprise][:root_path] %>;
2
+ passenger_ruby <%= node[:ruby_enterprise][:ruby_bin] %>;
@@ -0,0 +1,55 @@
1
+ = DESCRIPTION:
2
+
3
+ Installs Ruby Enterprise Edition (REE) from Phusion.
4
+
5
+ = REQUIREMENTS:
6
+
7
+ Opscode's build-essential cookbook to get a compiler and associated files installed.
8
+
9
+ = ATTRIBUTES:
10
+
11
+ * ruby_enterprise[:install_path] - Location to install REE. Default /opt/ruby-enterprise
12
+ * ruby_enterprise[:version] - Version-datestamp to use. Default 1.8.7-2011.03. May lag behind latest REE release.
13
+ * ruby_enterprise[:url] - URL to download. Default is from GoogleCode, with the version specified. Note the download ID must be updated when there are new releases.
14
+
15
+ = USAGE:
16
+
17
+ Include the ruby_enterprise recipe to install REE.
18
+
19
+ include_recipe "ruby_enterprise"
20
+
21
+ Or add it to your role, or directly to a node's recipes.
22
+
23
+ Install RubyGems under REE with the ree_gem definition.
24
+
25
+ ree_gem "rails" do
26
+ source "http://gems.rubyforge.org"
27
+ version "2.3.4"
28
+ end
29
+
30
+ The definition supports parameters for source and version, though they are optional.
31
+
32
+ = LICENSE and AUTHOR:
33
+
34
+ Author:: Mike Fiedler (<miketheman@gmail.com>)
35
+ Author:: Joshua Timberman (<joshua@opscode.com>)
36
+ Author:: Sean Cribbs (<seancribbs@gmail.com>)
37
+ Author:: Michael Hale (<mikehale@gmail.com>)
38
+
39
+ Copyright:: 2011, Mike Fiedler
40
+ Copyright:: 2009-2010, Opscode, Inc.
41
+ Copyright:: 2009, Sean Cribbs
42
+ Copyright:: 2009, Michael Hale
43
+
44
+ Licensed under the Apache License, Version 2.0 (the "License");
45
+ you may not use this file except in compliance with the License.
46
+ You may obtain a copy of the License at
47
+
48
+ http://www.apache.org/licenses/LICENSE-2.0
49
+
50
+ Unless required by applicable law or agreed to in writing, software
51
+ distributed under the License is distributed on an "AS IS" BASIS,
52
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53
+ See the License for the specific language governing permissions and
54
+ limitations under the License.
55
+