from-scratch 0.3.0 → 0.5.0

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 (209) hide show
  1. checksums.yaml +4 -4
  2. data/Berksfile +2 -1
  3. data/Berksfile.lock +20 -1
  4. data/cookbooks/bluepill/CHANGELOG.md +93 -0
  5. data/cookbooks/bluepill/README.md +91 -0
  6. data/cookbooks/bluepill/attributes/default.rb +44 -0
  7. data/cookbooks/bluepill/metadata.json +1 -0
  8. data/cookbooks/bluepill/providers/service.rb +172 -0
  9. data/cookbooks/bluepill/recipes/default.rb +48 -0
  10. data/cookbooks/bluepill/recipes/rsyslog.rb +28 -0
  11. data/cookbooks/bluepill/resources/service.rb +27 -0
  12. data/cookbooks/bluepill/templates/default/bluepill_init.fedora.erb +34 -0
  13. data/cookbooks/bluepill/templates/default/bluepill_init.freebsd.erb +32 -0
  14. data/cookbooks/bluepill/templates/default/bluepill_init.lsb.erb +37 -0
  15. data/cookbooks/bluepill/templates/default/bluepill_init.rhel.erb +34 -0
  16. data/cookbooks/bluepill/templates/default/bluepill_rsyslog.conf.erb +1 -0
  17. data/cookbooks/nginx/CHANGELOG.md +435 -0
  18. data/cookbooks/nginx/README.md +521 -0
  19. data/cookbooks/nginx/attributes/auth_request.rb +23 -0
  20. data/cookbooks/nginx/attributes/default.rb +131 -0
  21. data/cookbooks/nginx/attributes/devel.rb +24 -0
  22. data/cookbooks/nginx/attributes/echo.rb +24 -0
  23. data/cookbooks/nginx/attributes/geoip.rb +31 -0
  24. data/cookbooks/nginx/attributes/headers_more.rb +24 -0
  25. data/cookbooks/nginx/attributes/lua.rb +28 -0
  26. data/cookbooks/nginx/attributes/naxsi.rb +24 -0
  27. data/cookbooks/nginx/attributes/openssl_source.rb +23 -0
  28. data/cookbooks/nginx/attributes/pagespeed.rb +9 -0
  29. data/cookbooks/nginx/attributes/passenger.rb +58 -0
  30. data/cookbooks/nginx/attributes/rate_limiting.rb +23 -0
  31. data/cookbooks/nginx/attributes/repo.rb +35 -0
  32. data/cookbooks/nginx/attributes/set_misc.rb +8 -0
  33. data/cookbooks/nginx/attributes/socketproxy.rb +13 -0
  34. data/cookbooks/nginx/attributes/source.rb +42 -0
  35. data/cookbooks/nginx/attributes/status.rb +22 -0
  36. data/cookbooks/nginx/attributes/syslog.rb +24 -0
  37. data/cookbooks/nginx/attributes/upload_progress.rb +26 -0
  38. data/cookbooks/nginx/definitions/nginx_site.rb +50 -0
  39. data/cookbooks/nginx/files/default/mime.types +78 -0
  40. data/cookbooks/nginx/files/default/naxsi_core.rules +82 -0
  41. data/cookbooks/nginx/libraries/matchers.rb +20 -0
  42. data/cookbooks/nginx/metadata.json +351 -0
  43. data/cookbooks/nginx/recipes/authorized_ips.rb +32 -0
  44. data/cookbooks/nginx/recipes/commons.rb +24 -0
  45. data/cookbooks/nginx/recipes/commons_conf.rb +42 -0
  46. data/cookbooks/nginx/recipes/commons_dir.rb +57 -0
  47. data/cookbooks/nginx/recipes/commons_script.rb +29 -0
  48. data/cookbooks/nginx/recipes/default.rb +31 -0
  49. data/cookbooks/nginx/recipes/headers_more_module.rb +50 -0
  50. data/cookbooks/nginx/recipes/http_auth_request_module.rb +52 -0
  51. data/cookbooks/nginx/recipes/http_echo_module.rb +46 -0
  52. data/cookbooks/nginx/recipes/http_geoip_module.rb +113 -0
  53. data/cookbooks/nginx/recipes/http_gzip_static_module.rb +30 -0
  54. data/cookbooks/nginx/recipes/http_mp4_module.rb +2 -0
  55. data/cookbooks/nginx/recipes/http_perl_module.rb +23 -0
  56. data/cookbooks/nginx/recipes/http_realip_module.rb +38 -0
  57. data/cookbooks/nginx/recipes/http_spdy_module.rb +23 -0
  58. data/cookbooks/nginx/recipes/http_ssl_module.rb +23 -0
  59. data/cookbooks/nginx/recipes/http_stub_status_module.rb +36 -0
  60. data/cookbooks/nginx/recipes/ipv6.rb +23 -0
  61. data/cookbooks/nginx/recipes/lua.rb +47 -0
  62. data/cookbooks/nginx/recipes/naxsi_module.rb +52 -0
  63. data/cookbooks/nginx/recipes/ngx_devel_module.rb +44 -0
  64. data/cookbooks/nginx/recipes/ngx_lua_module.rb +47 -0
  65. data/cookbooks/nginx/recipes/ohai_plugin.rb +35 -0
  66. data/cookbooks/nginx/recipes/openssl_source.rb +45 -0
  67. data/cookbooks/nginx/recipes/package.rb +52 -0
  68. data/cookbooks/nginx/recipes/pagespeed_module.rb +62 -0
  69. data/cookbooks/nginx/recipes/passenger.rb +56 -0
  70. data/cookbooks/nginx/recipes/repo.rb +41 -0
  71. data/cookbooks/nginx/recipes/repo_passenger.rb +39 -0
  72. data/cookbooks/nginx/recipes/set_misc.rb +30 -0
  73. data/cookbooks/nginx/recipes/socketproxy.rb +26 -0
  74. data/cookbooks/nginx/recipes/source.rb +205 -0
  75. data/cookbooks/nginx/recipes/syslog_module.rb +69 -0
  76. data/cookbooks/nginx/recipes/upload_progress_module.rb +53 -0
  77. data/cookbooks/nginx/templates/debian/nginx.init.erb +97 -0
  78. data/cookbooks/nginx/templates/default/default-site.erb +11 -0
  79. data/cookbooks/nginx/templates/default/modules/authorized_ip.erb +6 -0
  80. data/cookbooks/nginx/templates/default/modules/http_geoip.conf.erb +4 -0
  81. data/cookbooks/nginx/templates/default/modules/http_gzip_static.conf.erb +1 -0
  82. data/cookbooks/nginx/templates/default/modules/http_realip.conf.erb +7 -0
  83. data/cookbooks/nginx/templates/default/modules/nginx_status.erb +14 -0
  84. data/cookbooks/nginx/templates/default/modules/passenger.conf.erb +13 -0
  85. data/cookbooks/nginx/templates/default/modules/socketproxy.conf.erb +89 -0
  86. data/cookbooks/nginx/templates/default/modules/upload_progress.erb +4 -0
  87. data/cookbooks/nginx/templates/default/nginx-upstart.conf.erb +39 -0
  88. data/cookbooks/nginx/templates/default/nginx.conf.erb +103 -0
  89. data/cookbooks/nginx/templates/default/nginx.init.erb +111 -0
  90. data/cookbooks/nginx/templates/default/nginx.pill.erb +15 -0
  91. data/cookbooks/nginx/templates/default/nginx.sysconfig.erb +1 -0
  92. data/cookbooks/nginx/templates/default/nxdissite.erb +29 -0
  93. data/cookbooks/nginx/templates/default/nxensite.erb +38 -0
  94. data/cookbooks/nginx/templates/default/plugins/nginx.rb.erb +66 -0
  95. data/cookbooks/nginx/templates/default/sv-nginx-log-run.erb +2 -0
  96. data/cookbooks/nginx/templates/default/sv-nginx-run.erb +4 -0
  97. data/cookbooks/nginx/templates/gentoo/nginx.init.erb +87 -0
  98. data/cookbooks/nginx/templates/suse/nginx.init.erb +115 -0
  99. data/cookbooks/nginx/templates/ubuntu/nginx.init.erb +97 -0
  100. data/cookbooks/ohai/CHANGELOG.md +69 -0
  101. data/cookbooks/ohai/README.md +89 -0
  102. data/cookbooks/ohai/attributes/default.rb +31 -0
  103. data/cookbooks/ohai/files/default/plugins/README +1 -0
  104. data/cookbooks/ohai/libraries/matchers.rb +14 -0
  105. data/cookbooks/ohai/metadata.json +1 -0
  106. data/cookbooks/ohai/providers/hint.rb +38 -0
  107. data/cookbooks/ohai/recipes/default.rb +52 -0
  108. data/cookbooks/ohai/resources/hint.rb +5 -0
  109. data/cookbooks/packagecloud/CHANGELOG.md +12 -0
  110. data/cookbooks/packagecloud/README.md +80 -0
  111. data/cookbooks/packagecloud/attributes/default.rb +8 -0
  112. data/cookbooks/packagecloud/libraries/helper.rb +43 -0
  113. data/cookbooks/packagecloud/libraries/matcher.rb +7 -0
  114. data/cookbooks/packagecloud/metadata.json +1 -0
  115. data/cookbooks/packagecloud/providers/repo.rb +212 -0
  116. data/cookbooks/packagecloud/resources/repo.rb +10 -0
  117. data/cookbooks/packagecloud/templates/.kitchen/logs/kitchen.log +29 -0
  118. data/cookbooks/packagecloud/templates/default/apt.erb +2 -0
  119. data/cookbooks/packagecloud/templates/default/yum.erb +15 -0
  120. data/cookbooks/rsyslog/CHANGELOG.md +193 -0
  121. data/cookbooks/rsyslog/README.md +276 -0
  122. data/cookbooks/rsyslog/attributes/default.rb +131 -0
  123. data/cookbooks/rsyslog/libraries/helpers.rb +25 -0
  124. data/cookbooks/rsyslog/metadata.json +1 -0
  125. data/cookbooks/rsyslog/providers/file_input.rb +44 -0
  126. data/cookbooks/rsyslog/recipes/client.rb +87 -0
  127. data/cookbooks/rsyslog/recipes/default.rb +89 -0
  128. data/cookbooks/rsyslog/recipes/server.rb +44 -0
  129. data/cookbooks/rsyslog/resources/file_input.rb +28 -0
  130. data/cookbooks/rsyslog/templates/default/35-server-per-host.conf.erb +62 -0
  131. data/cookbooks/rsyslog/templates/default/49-relp.conf.erb +10 -0
  132. data/cookbooks/rsyslog/templates/default/49-remote.conf.erb +30 -0
  133. data/cookbooks/rsyslog/templates/default/50-default.conf.erb +6 -0
  134. data/cookbooks/rsyslog/templates/default/file-input.conf.erb +15 -0
  135. data/cookbooks/rsyslog/templates/default/omnios-manifest.xml.erb +30 -0
  136. data/cookbooks/rsyslog/templates/default/rsyslog.conf.erb +117 -0
  137. data/cookbooks/rsyslog/templates/smartos/50-default.conf.erb +18 -0
  138. data/cookbooks/runit/.kitchen.cloud.yml +103 -0
  139. data/cookbooks/runit/.kitchen.yml +38 -0
  140. data/cookbooks/runit/.rspec +3 -0
  141. data/cookbooks/runit/.rubocop.yml +45 -0
  142. data/cookbooks/runit/Berksfile.disabled +11 -0
  143. data/cookbooks/runit/CHANGELOG.md +226 -0
  144. data/cookbooks/runit/CONTRIBUTING.md +266 -0
  145. data/cookbooks/runit/Cheffile +11 -0
  146. data/cookbooks/runit/Gemfile +17 -0
  147. data/cookbooks/runit/LICENSE +201 -0
  148. data/cookbooks/runit/README.md +435 -0
  149. data/cookbooks/runit/Rakefile +23 -0
  150. data/cookbooks/runit/TESTING.md +26 -0
  151. data/cookbooks/runit/attributes/default.rb +62 -0
  152. data/cookbooks/runit/files/default/runit.seed +1 -0
  153. data/cookbooks/runit/files/default/runsvdir +0 -0
  154. data/cookbooks/runit/files/ubuntu-6.10/runsvdir +6 -0
  155. data/cookbooks/runit/files/ubuntu-7.04/runsvdir +7 -0
  156. data/cookbooks/runit/files/ubuntu-7.10/runsvdir +7 -0
  157. data/cookbooks/runit/files/ubuntu-8.04/runsvdir +7 -0
  158. data/cookbooks/runit/libraries/default.rb +0 -0
  159. data/cookbooks/runit/libraries/helpers.rb +190 -0
  160. data/cookbooks/runit/libraries/matchers.rb +69 -0
  161. data/cookbooks/runit/libraries/provider_runit_service.rb +326 -0
  162. data/cookbooks/runit/libraries/resource_runit_service.rb +267 -0
  163. data/cookbooks/runit/metadata.json +50 -0
  164. data/cookbooks/runit/recipes/default.rb +91 -0
  165. data/cookbooks/runit/templates/debian/init.d.erb +66 -0
  166. data/cookbooks/runit/templates/default/log-config.erb +24 -0
  167. data/cookbooks/runit/templates/gentoo/runit-start.sh.erb +32 -0
  168. data/cookbooks/scratchify/Berksfile +2 -1
  169. data/cookbooks/scratchify/Berksfile.lock +20 -1
  170. data/cookbooks/scratchify/lib/from-scratch.rb +1 -4
  171. data/cookbooks/scratchify/lib/from-scratch/version.rb +1 -1
  172. data/cookbooks/scratchify/metadata.json +5 -2
  173. data/cookbooks/scratchify/recipes/default.rb +15 -1
  174. data/cookbooks/scratchify/recipes/nginx_site.rb +4 -0
  175. data/cookbooks/scratchify/recipes/pre_rvm.rb +5 -0
  176. data/cookbooks/scratchify/templates/nginx.erb +31 -0
  177. data/cookbooks/scratchify/templates/node.json.erb +21 -6
  178. data/cookbooks/yum-epel/CHANGELOG.md +84 -0
  179. data/cookbooks/yum-epel/README.md +172 -0
  180. data/cookbooks/yum-epel/attributes/default.rb +1 -0
  181. data/cookbooks/yum-epel/attributes/epel-debuginfo.rb +28 -0
  182. data/cookbooks/yum-epel/attributes/epel-source.rb +28 -0
  183. data/cookbooks/yum-epel/attributes/epel-testing-debuginfo.rb +28 -0
  184. data/cookbooks/yum-epel/attributes/epel-testing-source.rb +28 -0
  185. data/cookbooks/yum-epel/attributes/epel-testing.rb +28 -0
  186. data/cookbooks/yum-epel/attributes/epel.rb +28 -0
  187. data/cookbooks/yum-epel/metadata.json +1 -0
  188. data/cookbooks/yum-epel/recipes/default.rb +61 -0
  189. data/cookbooks/yum/CHANGELOG.md +294 -0
  190. data/cookbooks/yum/README.md +285 -0
  191. data/cookbooks/yum/attributes/main.rb +100 -0
  192. data/cookbooks/yum/libraries/matchers.rb +27 -0
  193. data/cookbooks/yum/metadata.json +1 -0
  194. data/cookbooks/yum/providers/globalconfig.rb +41 -0
  195. data/cookbooks/yum/providers/repository.rb +106 -0
  196. data/cookbooks/yum/recipes/default.rb +26 -0
  197. data/cookbooks/yum/resources/globalconfig.rb +109 -0
  198. data/cookbooks/yum/resources/repository.rb +69 -0
  199. data/cookbooks/yum/templates/default/main.erb +276 -0
  200. data/cookbooks/yum/templates/default/repo.erb +125 -0
  201. data/lib/from-scratch.rb +1 -0
  202. data/lib/from-scratch/version.rb +1 -1
  203. data/metadata.rb +5 -1
  204. data/recipes/default.rb +15 -1
  205. data/recipes/nginx_site.rb +4 -0
  206. data/recipes/pre_rvm.rb +5 -0
  207. data/templates/nginx.erb +31 -0
  208. data/templates/node.json.erb +21 -6
  209. metadata +194 -1
@@ -0,0 +1,24 @@
1
+ <% if @config.log_size -%>
2
+ s<%= @config.log_size %>
3
+ <% end -%>
4
+ <% if @config.log_num -%>
5
+ n<%= @config.log_num %>
6
+ <% end -%>
7
+ <% if @config.log_min -%>
8
+ N<%= @config.log_min %>
9
+ <% end -%>
10
+ <% if @config.log_timeout -%>
11
+ t<%= @config.log_timeout %>
12
+ <% end -%>
13
+ <% if @config.log_processor -%>
14
+ !<%= @config.log_processor %>
15
+ <% end -%>
16
+ <% if @config.log_socket -%>
17
+ u<%= @config.log_socket %>
18
+ <% end -%>
19
+ <% if @config.log_prefix -%>
20
+ p<%= @config.log_prefix %>
21
+ <% end -%>
22
+ <% if @config.log_config_append -%>
23
+ <%= @config.log_config_append %>
24
+ <% end -%>
@@ -0,0 +1,32 @@
1
+ #!/sbin/runscript
2
+ # Copyright 1999-2006 Gentoo Foundation
3
+ # Distributed under the terms of the GNU General Public License v2
4
+ # $Header: $
5
+
6
+ depend() {
7
+ after net
8
+ }
9
+
10
+ start() {
11
+ ebegin "Starting runsvdir"
12
+ start-stop-daemon --start --exec /usr/bin/runsvdir \
13
+ --background --make-pidfile \
14
+ --pidfile /var/run/runsvdir.pid -- <%= node.runit.sv_dir %>
15
+ eend $?
16
+ }
17
+
18
+ stop() {
19
+ local ret1 ret2
20
+ ebegin "Stopping runsvdir"
21
+ start-stop-daemon --stop --oknodo --pidfile /var/run/runsvdir.pid
22
+ ret1=$?
23
+ eend ${ret1}
24
+
25
+ ebegin "Stopping services and logging"
26
+ sv shutdown -w 10 <%= node.runit.sv_dir %>/*
27
+ ret2=$?
28
+ eend ${ret2}
29
+
30
+ return $((ret1+ret2))
31
+ }
32
+
@@ -6,8 +6,9 @@ source "https://supermarket.chef.io"
6
6
  metadata
7
7
 
8
8
  cookbook 'user'
9
- cookbook 'rvm', github: 'fnichol/chef-rvm'
9
+ cookbook 'rvm', github: 'martinisoft/chef-rvm'
10
10
  cookbook 'postgresql', github: 'sandrew/postgresql', branch: 'develop'
11
+ cookbook 'nginx'
11
12
 
12
13
  # cookbook 'dpkg_packages', git: "https://gitlab.acid.cl/acidlabs/chef-dpkg-packages.git"
13
14
  # cookbook 'nginx', git: "https://gitlab.acid.cl/acidlabs/chef-nginx.git"
@@ -1,10 +1,11 @@
1
1
  DEPENDENCIES
2
+ nginx
2
3
  postgresql
3
4
  git: git://github.com/sandrew/postgresql.git
4
5
  revision: a1f3ce3e2e22515bc175011a3e3faa0af98dd8db
5
6
  branch: develop
6
7
  rvm
7
- git: git://github.com/fnichol/chef-rvm.git
8
+ git: git://github.com/martinisoft/chef-rvm.git
8
9
  revision: 08ec265f277e112a5a2e4b201bd32ddfe1bb968c
9
10
  scratchify
10
11
  path: .
@@ -13,21 +14,39 @@ DEPENDENCIES
13
14
 
14
15
  GRAPH
15
16
  apt (2.9.2)
17
+ bluepill (2.4.0)
18
+ rsyslog (>= 0.0.0)
16
19
  build-essential (2.2.4)
17
20
  chef-sugar (3.1.1)
18
21
  chef_gem (0.1.0)
19
22
  java (1.35.0)
23
+ nginx (2.7.6)
24
+ apt (~> 2.2)
25
+ bluepill (~> 2.3)
26
+ build-essential (~> 2.0)
27
+ ohai (~> 2.0)
28
+ runit (~> 1.2)
29
+ yum-epel (~> 0.3)
30
+ ohai (2.0.3)
20
31
  openssl (4.4.0)
21
32
  chef-sugar (>= 3.1.1)
33
+ packagecloud (0.1.0)
22
34
  postgresql (3.4.21)
23
35
  apt (>= 1.9.0)
24
36
  build-essential (>= 0.0.0)
25
37
  openssl (~> 4.0)
38
+ rsyslog (2.2.0)
39
+ runit (1.7.4)
40
+ packagecloud (>= 0.0.0)
26
41
  rvm (0.10.1)
27
42
  chef_gem (>= 0.0.0)
28
43
  java (>= 0.0.0)
29
44
  scratchify (0.1.0)
45
+ nginx (>= 0.0.0)
30
46
  postgresql (>= 0.0.0)
31
47
  rvm (>= 0.0.0)
32
48
  user (>= 0.0.0)
33
49
  user (0.4.2)
50
+ yum (3.8.1)
51
+ yum-epel (0.6.4)
52
+ yum (~> 3.2)
@@ -7,10 +7,7 @@ module FromScratch
7
7
  app_name, host = ARGV
8
8
  ssh_pub_key = `cat ~/.ssh/id_rsa.pub`.strip
9
9
  postgresql_admin_password = `echo -n '#{SecureRandom.base64(16)}''postgres' | openssl md5 | sed -e 's/.* /md5/'`.strip
10
-
11
- puts "Your PG #{app_name} password is:"
12
- puts postgresql_user_password = SecureRandom.base64(16)
13
- puts
10
+ postgresql_user_password = SecureRandom.base64(16)
14
11
 
15
12
  { node: ['nodes', host], user: ['data_bags/users', 'deploy'] }.each do |from, to|
16
13
  FileUtils.mkdir_p File.expand_path("../../tmp/#{to[0]}", __FILE__)
@@ -1,3 +1,3 @@
1
1
  module FromScratch
2
- VERSION = "0.2.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -12,7 +12,8 @@
12
12
  "dependencies": {
13
13
  "user": ">= 0.0.0",
14
14
  "rvm": ">= 0.0.0",
15
- "postgresql": ">= 0.0.0"
15
+ "postgresql": ">= 0.0.0",
16
+ "nginx": ">= 0.0.0"
16
17
  },
17
18
  "recommendations": {
18
19
  },
@@ -29,7 +30,9 @@
29
30
  "groupings": {
30
31
  },
31
32
  "recipes": {
32
- "scratchify": "run all recipes."
33
+ "scratchify": "sets up some user directories and files",
34
+ "scratchify::pre_rvm": "workaround for RVM recipe bug",
35
+ "scratchify::nginx_site": "loads nginx site config"
33
36
  },
34
37
  "version": "0.1.0",
35
38
  "source_url": "",
@@ -1,4 +1,13 @@
1
- directory "/home/deploy/#{node['scratchify']['app_name']}/shared/config" do
1
+ ["#{node['scratchify']['app_name']}", "#{node['scratchify']['app_name']}/shared", "#{node['scratchify']['app_name']}/shared/config", "#{node['scratchify']['app_name']}/shared/log"].each do |path|
2
+ directory "/home/deploy/#{path}" do
3
+ owner 'deploy'
4
+ group 'deploy'
5
+ mode '0755'
6
+ recursive true
7
+ end
8
+ end
9
+
10
+ directory "/home/deploy/#{node['scratchify']['app_name']}/shared/log" do
2
11
  owner 'deploy'
3
12
  group 'deploy'
4
13
  mode '0755'
@@ -18,3 +27,8 @@ template "/home/deploy/#{node['scratchify']['app_name']}/shared/config/secrets.y
18
27
  group 'deploy'
19
28
  mode '0600'
20
29
  end
30
+
31
+ # required for json gem
32
+ if node['platform_family'] == 'debian'
33
+ package 'libgmp-dev'
34
+ end
@@ -0,0 +1,4 @@
1
+ nginx_site node['scratchify']['app_name'] do
2
+ enable true
3
+ template 'nginx.erb'
4
+ end
@@ -0,0 +1,5 @@
1
+ execute 'download RVM GPG key' do
2
+ user "deploy"
3
+ command "gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3"
4
+ environment 'HOME' => '/home/deploy'
5
+ end
@@ -0,0 +1,31 @@
1
+ upstream <%= node['scratchify']['app_name'] %>_upstream {
2
+ server unix:/home/deploy/<%= node['scratchify']['app_name'] %>/shared/tmp/sockets/application.sock fail_timeout=0;
3
+ }
4
+
5
+ server {
6
+ listen 80 default_server;
7
+ server_name localhost;
8
+
9
+ client_max_body_size 10M;
10
+ keepalive_timeout 10;
11
+
12
+ root /home/deploy/<%= node['scratchify']['app_name'] %>/current/public;
13
+ error_page 500 503 502 504 /500.html;
14
+ try_files $uri/index.html $uri @<%= node['scratchify']['app_name'] %>_location;
15
+
16
+ location @<%= node['scratchify']['app_name'] %>_location {
17
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
18
+ proxy_set_header Host $http_host;
19
+ proxy_redirect off;
20
+
21
+ proxy_pass http://<%= node['scratchify']['app_name'] %>_upstream;
22
+ access_log /home/deploy/<%= node['scratchify']['app_name'] %>/shared/log/nginx.access.log;
23
+ error_log /home/deploy/<%= node['scratchify']['app_name'] %>/shared/log/nginx.error.log;
24
+ }
25
+
26
+ location ^~ /assets/ {
27
+ gzip_static on;
28
+ expires max;
29
+ add_header Cache-Control public;
30
+ }
31
+ }
@@ -1,20 +1,30 @@
1
1
  {
2
2
  "run_list": [
3
- "recipe[rvm::system]",
3
+ "recipe[user::data_bag]",
4
+ "recipe[scratchify::pre_rvm]",
5
+ "recipe[rvm::user]",
4
6
  "recipe[postgresql::server]",
5
7
  "recipe[postgresql::config_pgtune]",
6
8
  "recipe[postgresql::setup_users]",
7
9
  "recipe[postgresql::setup_databases]",
8
- "recipe[user::data_bag]",
9
- "recipe[scratchify]"
10
+ "recipe[scratchify]",
11
+ "recipe[nginx]",
12
+ "recipe[scratchify::nginx_site]"
10
13
  ],
11
14
 
12
15
  "users": ["deploy"],
13
16
 
14
17
  "rvm": {
15
- "default_ruby": "2.2.3",
16
- "rubies": ["2.2.3"],
17
- "install_rubies": true,
18
+ "user_default_ruby": "2.2.3",
19
+ "user_install_rubies": true,
20
+ "installs": {
21
+ "deploy": true
22
+ },
23
+ "user_installs": [
24
+ {
25
+ "user": "deploy"
26
+ }
27
+ ],
18
28
  "gpg": {}
19
29
  },
20
30
 
@@ -65,6 +75,11 @@
65
75
  "app_name": "<%= app_name %>"
66
76
  },
67
77
 
78
+ "nginx": {
79
+ "default_site_enabled": false,
80
+ "pid": "/var/run/nginx.pid"
81
+ },
82
+
68
83
  "automatic": {
69
84
  "ipaddress": "<%= host %>"
70
85
  }
@@ -0,0 +1,84 @@
1
+ yum-epel Cookbook CHANGELOG
2
+ ======================
3
+ This file is used to list changes made in each version of the yum-epel cookbook.
4
+
5
+ v0.6.4 (2015-10-27)
6
+ -------------------
7
+ - Updating default recipe for Chef 13 deprecation warnings. Not
8
+ passing nil.
9
+
10
+ v0.6.3 (2015-09-22)
11
+ -------------------
12
+ - Added standard Chef gitignore and chefignore files
13
+ - Added the standard chef rubocop config
14
+ - Update contributing, maintainers, and testing docs
15
+ - Update Chefspec config to 4.X format
16
+ - Update distro versions in the Kitchen config
17
+ - Add Travis CI and cookbook version badges in the readme
18
+ - Expand the requirements section in the readme
19
+ - Add additional distros to the metadata
20
+ - Added source_url and issues_url metadata
21
+
22
+ v0.6.2 (2015-06-21)
23
+ -------------------
24
+ - Depending on yum ~> 3.2
25
+ - Support for the password attribute wasn't added to the
26
+ yum_repository LWRP until yum 3.2.0.
27
+
28
+ v0.6.1 (2015-06-21)
29
+ -------------------
30
+ - Switching to https for URL links
31
+ - Using metalink URLs
32
+
33
+ v0.6.0 (2015-01-03)
34
+ -------------------
35
+ - Adding EL7 support
36
+
37
+ v0.5.3 (2014-10-28)
38
+ -------------------
39
+ - Revert Use HTTPS for GPG keys and mirror lists
40
+
41
+ v0.5.2 (2014-10-28)
42
+ -------------------
43
+ - Use HTTPS for GPG keys and mirror lists
44
+ - Use local key on Amazon Linux
45
+
46
+ v0.5.0 (2014-09-02)
47
+ -------------------
48
+ - Add all attribute available to LWRP to allow for tuning.
49
+
50
+ v0.4.0 (2014-07-27)
51
+ -------------------
52
+ - [#9] Allowing list of repositories to reference configurable.
53
+
54
+ v0.3.6 (2014-04-09)
55
+ -------------------
56
+ - [COOK-4509] add RHEL7 support to yum-epel cookbook
57
+
58
+ v0.3.4 (2014-02-19)
59
+ -------------------
60
+ COOK-4353 - Fixing typo in readme
61
+
62
+ v0.3.2 (2014-02-13)
63
+ -------------------
64
+ Updating README to explain the 'managed' parameter
65
+
66
+ v0.3.0 (2014-02-12)
67
+ -------------------
68
+ [COOK-4292] - Do not manage secondary repos by default
69
+
70
+ v0.2.0
71
+ ------
72
+ Adding Amazon Linux support
73
+
74
+ v0.1.6
75
+ ------
76
+ Fixing up attribute values for EL6
77
+
78
+ v0.1.4
79
+ ------
80
+ Adding CHANGELOG.md
81
+
82
+ v0.1.0
83
+ ------
84
+ initial release
@@ -0,0 +1,172 @@
1
+ yum-epel Cookbook
2
+ ============
3
+ [![Build Status](https://travis-ci.org/chef-cookbooks/yum-epel.svg?branch=master)](http://travis-ci.org/chef-cookbooks/yum-epel)
4
+ [![Cookbook Version](https://img.shields.io/cookbook/v/yum-epel.svg)](https://supermarket.chef.io/cookbooks/yum-epel)
5
+
6
+ The yum-epel cookbook takes over management of the default
7
+ repositoryids shipped with epel-release. It allows attribute
8
+ manipulation of `epel`, `epel-debuginfo`, `epel-source`, `epel-testing`,
9
+ `epel-testing-debuginfo`, and `epel-testing-source`.
10
+
11
+ Requirements
12
+ ------------
13
+ #### Platforms
14
+ * RHEL/CentOS and derivatives
15
+ * Fedora
16
+
17
+ #### Chef
18
+ * Chef 11+
19
+
20
+ #### Cookbooks
21
+ * yum version 3.2.0 or higher
22
+
23
+
24
+ Attributes
25
+ ----------
26
+ The following attributes are set by default
27
+
28
+ ``` ruby
29
+ default['yum-epel']['repositories'] = %w{epel epel-debuginfo epel-source epel-testing epel-testing-debuginfo epel-testing-source}
30
+ ```
31
+
32
+ ``` ruby
33
+ default['yum']['epel']['repositoryid'] = 'epel'
34
+ default['yum']['epel']['description'] = 'Extra Packages for Enterprise Linux 6 - $basearch'
35
+ default['yum']['epel']['mirrorlist'] = 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch'
36
+ default['yum']['epel']['gpgkey'] = 'http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6'
37
+ default['yum']['epel']['failovermethod'] = 'priority'
38
+ default['yum']['epel']['gpgcheck'] = true
39
+ default['yum']['epel']['enabled'] = true
40
+ default['yum']['epel']['managed'] = true
41
+ ```
42
+
43
+ ``` ruby
44
+ default['yum']['epel-debuginfo']['repositoryid'] = 'epel-debuginfo'
45
+ default['yum']['epel-debuginfo']['description'] = 'Extra Packages for Enterprise Linux 6 - $basearch - Debug'
46
+ default['yum']['epel-debuginfo']['mirrorlist'] = 'https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch'
47
+ default['yum']['epel-debuginfo']['gpgkey'] = 'http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6'
48
+ default['yum']['epel-debuginfo']['failovermethod'] = 'priority'
49
+ default['yum']['epel-debuginfo']['gpgcheck'] = true
50
+ default['yum']['epel-debuginfo']['enabled'] = false
51
+ default['yum']['epel-debuginfo']['managed'] = false
52
+ ```
53
+
54
+ ``` ruby
55
+ default['yum']['epel-source']['repositoryid'] = 'epel-source'
56
+ default['yum']['epel-source']['description'] = 'Extra Packages for Enterprise Linux 6 - $basearch - Source'
57
+ default['yum']['epel-source']['mirrorlist'] = 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-6&arch=$basearch'
58
+ default['yum']['epel-source']['gpgkey'] = 'http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6'
59
+ default['yum']['epel-source']['failovermethod'] = 'priority'
60
+ default['yum']['epel-source']['gpgcheck'] = true
61
+ default['yum']['epel-source']['enabled'] = false
62
+ default['yum']['epel-source']['managed'] = false
63
+ ```
64
+
65
+ ``` ruby
66
+ default['yum']['epel-testing']['repositoryid'] = 'epel-testing'
67
+ default['yum']['epel-testing']['description'] = 'Extra Packages for Enterprise Linux 6 - Testing - $basearch'
68
+ default['yum']['epel-testing']['mirrorlist'] = 'https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=$basearch'
69
+ default['yum']['epel-testing']['gpgkey'] = 'http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6r'
70
+ default['yum']['epel-testing']['failovermethod'] = 'priority'
71
+ default['yum']['epel-testing']['gpgcheck'] = true
72
+ default['yum']['epel-testing']['enabled'] = false
73
+ default['yum']['epel-testing']['managed'] = false
74
+ ```
75
+
76
+ ``` ruby
77
+ default['yum']['epel-testing-debuginfo']['repositoryid'] = 'epel-testing-debuginfo'
78
+ default['yum']['epel-testing-debuginfo']['description'] = 'Extra Packages for Enterprise Linux 6 - Testing - $basearch Debug'
79
+ default['yum']['epel-testing-debuginfo']['mirrorlist'] = 'https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel6&arch=$basearch'
80
+ default['yum']['epel-testing-debuginfo']['gpgkey'] = 'http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6'
81
+ default['yum']['epel-testing-debuginfo']['failovermethod'] = 'priority'
82
+ default['yum']['epel-testing-debuginfo']['gpgcheck'] = true
83
+ default['yum']['epel-testing-debuginfo']['enabled'] = false
84
+ default['yum']['epel-testing-debuginfo']['managed'] = false
85
+ ```
86
+
87
+ ``` ruby
88
+ default['yum']['epel-testing-source']['repositoryid'] = 'epel-testing-source'
89
+ default['yum']['epel-testing-source']['description'] = 'Extra Packages for Enterprise Linux 6 - Testing - $basearch Source'
90
+ default['yum']['epel-testing-source']['mirrorlist'] = 'https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel6&arch=$basearch'
91
+ default['yum']['epel-testing-source']['gpgkey'] = 'http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6'
92
+ default['yum']['epel-testing-source']['failovermethod'] = 'priority'
93
+ default['yum']['epel-testing-source']['gpgcheck'] = true
94
+ default['yum']['epel-testing-source']['enabled'] = false
95
+ default['yum']['epel-testing-source']['managed'] = false
96
+ ```
97
+
98
+ Recipes
99
+ -------
100
+ * default - Walks through node attributes and feeds a yum_resource
101
+ parameters. The following is an example a resource generated by the
102
+ recipe during compilation.
103
+
104
+ ```ruby
105
+ yum_repository 'epel' do
106
+ mirrorlist 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch'
107
+ description 'Extra Packages for Enterprise Linux 5 - $basearch'
108
+ enabled true
109
+ gpgcheck true
110
+ gpgkey 'http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL'
111
+ end
112
+ ```
113
+
114
+ Usage Example
115
+ -------------
116
+ To disable the epel repository through a Role or Environment definition
117
+
118
+ ```
119
+ default_attributes(
120
+ :yum => {
121
+ :epel => {
122
+ :enabled => {
123
+ false
124
+ }
125
+ }
126
+ }
127
+ )
128
+ ```
129
+
130
+ Uncommonly used repositoryids are not managed by default. This is
131
+ speeds up integration testing pipelines by avoiding yum-cache builds
132
+ that nobody cares about. To enable the epel-testing repository with a
133
+ wrapper cookbook, place the following in a recipe:
134
+
135
+ ```
136
+ node.default['yum']['epel-testing']['enabled'] = true
137
+ node.default['yum']['epel-testing']['managed'] = true
138
+ include_recipe 'yum-epel'
139
+ ```
140
+
141
+ More Examples
142
+ -------------
143
+ Point the epel repositories at an internally hosted server.
144
+
145
+ ```
146
+ node.default['yum']['epel']['enabled'] = true
147
+ node.default['yum']['epel']['mirrorlist'] = nil
148
+ node.default['yum']['epel']['baseurl'] = 'https://internal.example.com/centos/6/os/x86_64'
149
+ node.default['yum']['epel']['sslverify'] = false
150
+
151
+ include_recipe 'yum-epel'
152
+ ```
153
+
154
+ License & Authors
155
+ -----------------
156
+
157
+ **Author:** Cookbook Engineering Team (<cookbooks@chef.io>)
158
+
159
+ **Copyright:** 2011-2015, Chef Software, Inc.
160
+ ```
161
+ Licensed under the Apache License, Version 2.0 (the "License");
162
+ you may not use this file except in compliance with the License.
163
+ You may obtain a copy of the License at
164
+
165
+ http://www.apache.org/licenses/LICENSE-2.0
166
+
167
+ Unless required by applicable law or agreed to in writing, software
168
+ distributed under the License is distributed on an "AS IS" BASIS,
169
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
170
+ See the License for the specific language governing permissions and
171
+ limitations under the License.
172
+ ```