Skip to content
Browse files

Merge branch 'master' of git://github.com/rightscale/rightscale_cookb…

…ooks
  • Loading branch information...
2 parents b172344 + f068519 commit d6b35ea5db6860f840638ec631d80d71b61c6b3e @ronniedada ronniedada committed Dec 12, 2012
Showing with 8,594 additions and 7,681 deletions.
  1. +1 −0 .gitignore
  2. +4 −0 Gemfile
  3. +24 −9 README.rdoc
  4. +20 −0 Rakefile
  5. +0 −12 config/README_template.rdoc
  6. +79 −78 cookbooks/app/README.rdoc
  7. +4 −0 cookbooks/app/attributes/default.rb
  8. +6 −4 cookbooks/app/libraries/helper.rb
  9. +35 −15 cookbooks/app/metadata.json
  10. +35 −13 cookbooks/app/metadata.rb
  11. +13 −1 cookbooks/app/providers/default.rb
  12. +3 −2 cookbooks/app/recipes/do_loadbalancers_allow.rb
  13. +3 −2 cookbooks/app/recipes/do_loadbalancers_deny.rb
  14. +16 −0 cookbooks/app/recipes/do_server_reload.rb
  15. +2 −4 cookbooks/app/recipes/do_server_restart.rb
  16. +2 −4 cookbooks/app/recipes/do_server_start.rb
  17. +2 −4 cookbooks/app/recipes/do_server_stop.rb
  18. +2 −4 cookbooks/app/recipes/do_update_code.rb
  19. +26 −0 cookbooks/app/recipes/handle_loadbalancers_allow.rb
  20. +26 −0 cookbooks/app/recipes/handle_loadbalancers_deny.rb
  21. +17 −0 cookbooks/app/recipes/{default.rb → install_server.rb}
  22. +10 −7 cookbooks/app/recipes/request_loadbalancer_allow.rb
  23. +9 −8 cookbooks/app/recipes/request_loadbalancer_deny.rb
  24. +3 −5 cookbooks/app/recipes/setup_db_connection.rb
  25. +2 −4 cookbooks/app/recipes/setup_monitoring.rb
  26. +6 −1 cookbooks/app/recipes/setup_vhost.rb
  27. +6 −3 cookbooks/app/resources/default.rb
  28. +158 −0 cookbooks/app_django/README.rdoc
  29. +36 −0 cookbooks/app_django/attributes/default.rb
  30. +96 −0 cookbooks/app_django/metadata.json
  31. +52 −0 cookbooks/app_django/metadata.rb
  32. +212 −0 cookbooks/app_django/providers/default.rb
  33. +34 −0 cookbooks/app_django/recipes/run_custom_django_commands.rb
  34. +59 −0 cookbooks/app_django/recipes/setup_server_1_4.rb
  35. +92 −0 cookbooks/app_django/templates/default/apache_mod_wsgi_vhost.erb
  36. +33 −0 cookbooks/app_django/templates/default/settings.py.erb
  37. +41 −0 cookbooks/app_django/templates/default/wsgi.py.erb
  38. +52 −78 cookbooks/app_passenger/README.rdoc
  39. +17 −31 cookbooks/app_passenger/attributes/default.rb
  40. +0 −3 cookbooks/app_passenger/files/RubyEE-readme.txt
  41. +0 −3,376 cookbooks/app_passenger/files/default/cacert.pem
  42. BIN cookbooks/app_passenger/files/default/ruby-enterprise_x86_64.tar.gz
  43. BIN cookbooks/app_passenger/files/ubuntu/ruby-enterprise_x86_64.tar.gz
  44. +69 −110 cookbooks/app_passenger/metadata.json
  45. +24 −35 cookbooks/app_passenger/metadata.rb
  46. +214 −74 cookbooks/app_passenger/providers/default.rb
  47. +0 −49 cookbooks/app_passenger/recipes/default.rb
  48. +1 −0 cookbooks/app_passenger/recipes/install_custom_gems.rb
  49. +4 −3 cookbooks/app_passenger/recipes/install_required_app_gems.rb
  50. +2 −1 cookbooks/app_passenger/recipes/run_custom_rails_commands.rb
  51. +57 −0 cookbooks/app_passenger/recipes/setup_server_3_0.rb
  52. +12 −24 cookbooks/app_passenger/templates/default/basic_vhost.erb
  53. +10 −0 cookbooks/app_passenger/templates/default/collectd_passenger.conf.erb
  54. +44 −0 cookbooks/app_passenger/templates/default/collectd_passenger.erb
  55. +3 −26 cookbooks/app_passenger/templates/default/database.yml.erb
  56. +4 −13 cookbooks/app_passenger/templates/default/{logrotate_rails.erb → passenger-status.erb}
  57. +44 −56 cookbooks/app_php/README.rdoc
  58. +5 −25 cookbooks/app_php/attributes/default.rb
  59. +31 −73 cookbooks/app_php/metadata.json
  60. +11 −22 cookbooks/app_php/metadata.rb
  61. +48 −32 cookbooks/app_php/providers/default.rb
  62. +0 −65 cookbooks/app_php/recipes/default.rb
  63. +35 −0 cookbooks/app_php/recipes/setup_server_5_3.rb
  64. +105 −71 cookbooks/app_tomcat/README.rdoc
  65. +8 −30 cookbooks/app_tomcat/attributes/default.rb
  66. +99 −119 cookbooks/app_tomcat/metadata.json
  67. +62 −39 cookbooks/app_tomcat/metadata.rb
  68. +147 −147 cookbooks/app_tomcat/providers/default.rb
  69. +0 −77 cookbooks/app_tomcat/recipes/default.rb
  70. +62 −0 cookbooks/app_tomcat/recipes/setup_server_6.rb
  71. +58 −0 cookbooks/app_tomcat/recipes/setup_server_7.rb
  72. +17 −24 cookbooks/app_tomcat/templates/default/apache_mod_jk_vhost.erb
  73. +76 −0 cookbooks/app_tomcat/templates/default/catalina.properties.erb
  74. +14 −22 cookbooks/app_tomcat/templates/default/context_xml.erb
  75. +13 −3 cookbooks/app_tomcat/templates/default/mod_jk.conf.erb
  76. +14 −14 cookbooks/app_tomcat/templates/default/server_xml.erb
  77. +0 −16 cookbooks/app_tomcat/templates/default/tomcat6_logrotate.conf.erb
  78. +25 −10 cookbooks/app_tomcat/templates/default/{tomcat6_conf.erb → tomcat_conf.erb}
  79. +7 −1 cookbooks/app_tomcat/templates/default/tomcat_workers.properties.erb
  80. +7 −13 cookbooks/app_tomcat/templates/default/web_xml.erb
  81. +73 −0 cookbooks/app_tomcat/templates/ubuntu/tomcat_conf.erb
  82. +32 −21 cookbooks/block_device/README.rdoc
  83. +4 −1 cookbooks/block_device/attributes/default.rb
  84. +0 −14 cookbooks/block_device/files/ubuntu/lvm_activate
  85. +29 −15 cookbooks/block_device/libraries/block_device.rb
  86. +125 −93 cookbooks/block_device/metadata.json
  87. +29 −16 cookbooks/block_device/metadata.rb
  88. +47 −35 cookbooks/block_device/providers/default.rb
  89. +18 −2 cookbooks/block_device/recipes/default.rb
  90. +7 −0 cookbooks/block_device/recipes/do_delete_volumes_and_terminate_server.rb
  91. +9 −0 cookbooks/block_device/recipes/do_force_reset.rb
  92. +7 −0 cookbooks/block_device/recipes/do_primary_backup.rb
  93. +6 −0 cookbooks/block_device/recipes/do_primary_backup_schedule_disable.rb
  94. +10 −1 cookbooks/block_device/recipes/do_primary_backup_schedule_enable.rb
  95. +9 −0 cookbooks/block_device/recipes/do_primary_restore.rb
  96. +8 −1 cookbooks/block_device/recipes/do_secondary_backup.rb
  97. +8 −1 cookbooks/block_device/recipes/do_secondary_restore.rb
  98. +8 −0 cookbooks/block_device/recipes/setup_block_device.rb
  99. +136 −88 cookbooks/block_device/recipes/setup_ephemeral.rb
  100. +79 −20 cookbooks/block_device/resources/default.rb
  101. +63 −40 cookbooks/db/README.rdoc
  102. +15 −12 cookbooks/db/attributes/default.rb
  103. +43 −0 cookbooks/db/definitions/db_connect_app.rb
  104. +20 −24 cookbooks/db/definitions/db_do_backup.rb
  105. +5 −4 cookbooks/db/definitions/db_init_status.rb
  106. +14 −3 cookbooks/db/definitions/db_register_master.rb
  107. +124 −102 cookbooks/db/definitions/db_register_slave.rb
  108. +4 −5 cookbooks/db/definitions/db_request_backup.rb
  109. +27 −0 cookbooks/db/definitions/db_set_privileges.rb
  110. +3 −1 cookbooks/db/definitions/db_state_assert.rb
  111. +1 −0 cookbooks/db/definitions/db_state_set.rb
  112. +368 −332 cookbooks/db/metadata.json
  113. +134 −67 cookbooks/db/metadata.rb
  114. +30 −3 cookbooks/db/recipes/default.rb
  115. +1 −0 cookbooks/db/recipes/do_appservers_allow.rb
  116. +2 −0 cookbooks/db/recipes/do_appservers_deny.rb
  117. +6 −0 cookbooks/db/recipes/do_delete_volumes_and_terminate_server.rb
  118. +2 −0 cookbooks/db/recipes/do_dump_export.rb
  119. +3 −2 cookbooks/db/recipes/do_dump_import.rb
  120. +2 −1 cookbooks/db/recipes/do_dump_schedule_enable.rb
  121. +14 −1 cookbooks/db/recipes/do_force_reset.rb
  122. +20 −4 cookbooks/db/recipes/do_init_and_become_master.rb
  123. +1 −0 cookbooks/db/recipes/do_init_slave_at_boot.rb
  124. +3 −5 cookbooks/db/recipes/do_primary_backup.rb
  125. +2 −0 cookbooks/db/recipes/do_primary_backup_schedule_disable.rb
  126. +6 −0 cookbooks/db/recipes/do_primary_backup_schedule_enable.rb
  127. +4 −0 cookbooks/db/recipes/do_primary_init_slave.rb
  128. +16 −1 cookbooks/db/recipes/do_primary_restore.rb
  129. +16 −4 cookbooks/db/recipes/do_primary_restore_and_become_master.rb
  130. +18 −6 cookbooks/db/recipes/do_promote_to_master.rb
  131. +1 −1 cookbooks/db/recipes/do_secondary_backup.rb
  132. +2 −0 cookbooks/db/recipes/do_secondary_init_slave.rb
  133. +18 −3 cookbooks/db/recipes/do_secondary_restore.rb
  134. +16 −4 cookbooks/db/recipes/do_secondary_restore_and_become_master.rb
  135. +2 −0 cookbooks/db/recipes/do_set_dns_slave_private_ip.rb
  136. +14 −7 cookbooks/db/recipes/handle_demote_master.rb
  137. +24 −5 cookbooks/db/recipes/install_server.rb
  138. +26 −0 cookbooks/db/recipes/remove_anonymous_users.rb
  139. +3 −1 cookbooks/db/recipes/request_appserver_allow.rb
  140. +3 −1 cookbooks/db/recipes/request_appserver_deny.rb
  141. +2 −0 cookbooks/db/recipes/request_master_allow.rb
  142. +2 −0 cookbooks/db/recipes/request_master_deny.rb
  143. +53 −0 cookbooks/db/recipes/setup_monitoring.rb
  144. +3 −11 cookbooks/db/recipes/setup_privileges_admin.rb
  145. +3 −11 cookbooks/db/recipes/setup_privileges_application.rb
  146. +1 −0 cookbooks/db/recipes/setup_replication_privileges.rb
  147. +41 −45 cookbooks/db/resources/default.rb
  148. 0 cookbooks/{db_mysql → db}/templates/default/db_connection_example.erb
  149. +60 −10 cookbooks/db_mysql/README.rdoc
  150. +4 −14 cookbooks/db_mysql/attributes/default.rb
  151. +9 −10 cookbooks/db_mysql/attributes/mysql_tuning.rb
  152. +0 −29 cookbooks/db_mysql/definitions/db_mysql_connect_app.rb
  153. +39 −0 cookbooks/db_mysql/definitions/db_mysql_set_mycnf.rb
  154. +26 −0 cookbooks/db_mysql/definitions/db_mysql_set_mysql_read_only.rb
  155. +11 −5 cookbooks/db_mysql/definitions/db_mysql_set_privileges.rb
  156. +30 −0 cookbooks/db_mysql/files/default/setup_my_cnf.sh
  157. +18 −18 cookbooks/db_mysql/libraries/helper.rb
  158. +101 −69 cookbooks/db_mysql/metadata.json
  159. +35 −28 cookbooks/db_mysql/metadata.rb
  160. +319 −102 cookbooks/db_mysql/providers/default.rb
  161. +0 −36 cookbooks/db_mysql/recipes/default_5_1.rb
  162. +0 −32 cookbooks/db_mysql/recipes/default_5_5.rb
  163. +58 −0 cookbooks/db_mysql/recipes/setup_server_5_1.rb
  164. +56 −0 cookbooks/db_mysql/recipes/setup_server_5_5.rb
  165. +135 −0 cookbooks/db_mysql/templates/centos-5/my.cnf.erb
  166. +129 −0 cookbooks/db_mysql/templates/centos-6.2/my.cnf.erb
  167. +7 −17 cookbooks/db_mysql/templates/default/my.cnf.erb
  168. +4 −9 ...rightscale/files/default/logrotate.d.mail → db_mysql/templates/default/read_write_status.cnf.erb}
  169. +2 −2 cookbooks/db_mysql/templates/default/sysconfig-mysqld.erb
  170. +135 −0 cookbooks/db_mysql/templates/redhat-5/my.cnf.erb
  171. +37 −46 cookbooks/db_postgres/README.rdoc
  172. +1 −9 cookbooks/db_postgres/attributes/default.rb
  173. +4 −7 cookbooks/db_postgres/attributes/postgres_tuning.rb
  174. +0 −26 cookbooks/db_postgres/definitions/db_postgres_connect_app.rb
  175. +13 −10 cookbooks/db_postgres/definitions/db_postgres_set_privileges.rb
  176. 0 cookbooks/db_postgres/files/{centos → default}/check_hot_standby_delay
  177. 0 cookbooks/db_postgres/files/{centos → default}/pg_cluster_status
  178. 0 cookbooks/db_postgres/files/{centos → default}/pg_hba.conf
  179. 0 cookbooks/db_postgres/files/{centos → default}/postgres_ps
  180. +0 −8 cookbooks/db_postgres/libraries/helper.rb
  181. +7 −7 cookbooks/db_postgres/metadata.json
  182. +10 −8 cookbooks/db_postgres/metadata.rb
  183. +212 −63 cookbooks/db_postgres/providers/default.rb
  184. +0 −32 cookbooks/db_postgres/recipes/default.rb
  185. +1 −0 cookbooks/db_postgres/recipes/do_set_slave_async_mode.rb
  186. +1 −0 cookbooks/db_postgres/recipes/do_set_slave_sync_mode.rb
  187. +2 −1 cookbooks/db_postgres/recipes/do_show_slave_sync_mode.rb
  188. +51 −0 cookbooks/db_postgres/recipes/setup_server_9_1.rb
  189. 0 cookbooks/db_postgres/templates/{centos → default}/check_hot_standby_delay_exec.erb
  190. +0 −19 cookbooks/db_postgres/templates/default/db_connection_example.erb
  191. 0 cookbooks/db_postgres/templates/{centos → default}/pg_cluster_status_exec.erb
  192. +2 −3 cookbooks/db_postgres/templates/default/postgres_collectd_exec.erb
  193. +1 −1 cookbooks/db_postgres/templates/default/postgresql.conf.erb
  194. +14 −5 cookbooks/db_postgres/templates/default/postgresql_collectd_plugin.conf.erb
  195. +4 −3 cookbooks/lamp/README.rdoc
  196. +0 −10 cookbooks/lamp/attributes/default.rb
  197. +17 −17 cookbooks/lamp/metadata.json
  198. +6 −2 cookbooks/lamp/metadata.rb
  199. +3 −2 cookbooks/lamp/recipes/default.rb
  200. +11 −12 cookbooks/lb/README.rdoc
  201. +4 −7 cookbooks/lb/attributes/default.rb
  202. +3 −2 cookbooks/lb/definitions/lb_tag.rb
  203. +12 −10 cookbooks/lb/libraries/helper.rb
  204. +27 −25 cookbooks/lb/metadata.json
  205. +35 −23 cookbooks/lb/metadata.rb
  206. +7 −5 cookbooks/lb/recipes/default.rb
  207. +33 −26 cookbooks/lb/recipes/do_attach_all.rb
  208. +9 −5 cookbooks/lb/recipes/do_attach_request.rb
  209. +9 −5 cookbooks/lb/recipes/do_detach_request.rb
  210. +6 −3 cookbooks/lb/recipes/handle_attach.rb
  211. +6 −3 cookbooks/lb/recipes/handle_detach.rb
  212. +34 −0 cookbooks/lb/recipes/install_server.rb
  213. +6 −10 cookbooks/{lb_haproxy/recipes/default.rb → lb/recipes/setup_advanced_configuration.rb}
  214. +0 −30 cookbooks/lb/recipes/setup_load_balancer.rb
  215. +12 −5 cookbooks/lb/recipes/setup_monitoring.rb
  216. +6 −2 cookbooks/lb/recipes/setup_reverse_proxy_config.rb
  217. +15 −18 cookbooks/lb/resources/default.rb
  218. +1 −1 cookbooks/lb_clb/README.rdoc
  219. +2 −2 cookbooks/lb_clb/metadata.json
  220. +5 −1 cookbooks/lb_clb/metadata.rb
  221. +29 −17 cookbooks/lb_clb/providers/default.rb
  222. +19 −13 cookbooks/lb_clb/templates/default/clb_attach_exec.erb
  223. +16 −16 cookbooks/lb_clb/templates/default/clb_detach_exec.erb
  224. +1 −1 cookbooks/lb_elb/README.rdoc
  225. +2 −2 cookbooks/lb_elb/metadata.json
  226. +5 −1 cookbooks/lb_elb/metadata.rb
  227. +26 −15 cookbooks/lb_elb/providers/default.rb
  228. +25 −13 cookbooks/lb_haproxy/README.rdoc
  229. +12 −0 cookbooks/lb_haproxy/attributes/default.rb
  230. +35 −0 cookbooks/lb_haproxy/definitions/haproxy_backend.rb
  231. +23 −19 cookbooks/lb_haproxy/files/default/haproxy-cat.sh
  232. +3 −3 cookbooks/lb_haproxy/files/default/haproxy1.4.rb
  233. +63 −19 cookbooks/lb_haproxy/metadata.json
  234. +34 −2 cookbooks/lb_haproxy/metadata.rb
  235. +176 −101 cookbooks/lb_haproxy/providers/default.rb
  236. +34 −0 cookbooks/lb_haproxy/recipes/setup_server.rb
  237. 0 ...ooks/lb_haproxy/templates/default/{haproxy_default_backend.erb → haproxy.cfg.default_backend.erb}
  238. +4 −5 cookbooks/lb_haproxy/templates/default/{haproxy_http.erb → haproxy.cfg.head.erb}
  239. +0 −130 cookbooks/lb_haproxy/templates/default/haproxy.init.erb
  240. +5 −1 cookbooks/lb_haproxy/templates/default/haproxy_backend.erb
  241. +6 −0 cookbooks/lb_haproxy/templates/default/haproxy_backend_acl.erb
  242. +4 −0 cookbooks/lb_haproxy/templates/default/haproxy_backend_list.erb
  243. +2 −0 cookbooks/lb_haproxy/templates/default/haproxy_backend_use.erb
  244. +8 −0 cookbooks/lb_haproxy/templates/default/haproxy_backend_userlist.erb
  245. +1 −1 cookbooks/lb_haproxy/templates/default/haproxy_collectd_exec.erb
  246. +0 −2 cookbooks/lb_haproxy/templates/{default → ubuntu}/default_haproxy.erb
  247. +5 −1 cookbooks/lb_haproxy/templates/ubuntu/haproxy_backend.erb
  248. +47 −19 cookbooks/logging/README.rdoc
  249. +1 −0 cookbooks/logging/attributes/default.rb
  250. +70 −34 cookbooks/logging/metadata.json
  251. +31 −13 cookbooks/logging/metadata.rb
  252. +10 −7 cookbooks/logging/recipes/default.rb
  253. +17 −0 cookbooks/logging/recipes/do_server_reload.rb
  254. +8 −0 cookbooks/logging/recipes/do_server_restart.rb
  255. +8 −0 cookbooks/logging/recipes/do_server_start.rb
  256. +8 −0 cookbooks/logging/recipes/do_server_stop.rb
  257. +10 −0 cookbooks/logging/recipes/install_server.rb
  258. +21 −22 cookbooks/logging/resources/default.rb
  259. +5 −5 cookbooks/logging_rsyslog/README.rdoc
  260. +101 −0 cookbooks/logging_rsyslog/definitions/configure_stunnel.rb
  261. +17 −17 cookbooks/logging_rsyslog/metadata.json
  262. +6 −2 cookbooks/logging_rsyslog/metadata.rb
  263. +103 −35 cookbooks/logging_rsyslog/providers/default.rb
  264. +1 −1 cookbooks/logging_rsyslog/recipes/{default.rb → setup_server.rb}
  265. +62 −0 cookbooks/logging_rsyslog/templates/default/client.conf.erb
  266. +0 −7 cookbooks/logging_rsyslog/templates/default/rsyslog.d.remote.conf.erb
  267. +0 −9 cookbooks/logging_rsyslog/templates/default/rsyslog.d.server.conf.erb
  268. +22 −0 cookbooks/logging_rsyslog/templates/default/server.conf.erb
  269. +53 −0 cookbooks/logging_rsyslog/templates/default/stunnel.conf.erb
  270. +4 −10 cookbooks/{rightscale/files/default/mail → logging_rsyslog/templates/default/stunnel.pem.erb}
  271. +108 −0 cookbooks/logging_rsyslog/templates/default/stunnel.sh.erb
  272. +7 −7 cookbooks/logging_syslog_ng/README.rdoc
  273. +3 −3 cookbooks/logging_syslog_ng/metadata.json
  274. +5 −1 cookbooks/logging_syslog_ng/metadata.rb
  275. +6 −0 cookbooks/logging_syslog_ng/providers/default.rb
  276. +1 −1 cookbooks/logging_syslog_ng/recipes/{default.rb → setup_server.rb}
  277. +55 −0 cookbooks/memcached/README.rdoc
  278. +22 −0 cookbooks/memcached/attributes/default.rb
  279. +180 −0 cookbooks/memcached/metadata.json
  280. +90 −0 cookbooks/memcached/metadata.rb
  281. +10 −0 cookbooks/memcached/recipes/default.rb
  282. +5 −7 cookbooks/{db_mysql/recipes/default.rb → memcached/recipes/do_restart.rb}
  283. +17 −0 cookbooks/memcached/recipes/do_start.rb
  284. +17 −0 cookbooks/memcached/recipes/do_stop.rb
  285. +190 −0 cookbooks/memcached/recipes/install_server.rb
  286. +39 −0 cookbooks/memcached/templates/default/memcached.conf.erb
  287. +10 −3 ...ates/centos/postgres_collectd_exec.erb → memcached/templates/default/memcached_collectd.conf.erb}
  288. +63 −0 cookbooks/memcached/templates/default/memcached_listen_disabled_num_plugin.erb
  289. +53 −0 cookbooks/memcached/templates/ubuntu/memcached.conf.erb
  290. +22 −63 cookbooks/repo/README.rdoc
  291. +5 −9 cookbooks/repo/attributes/default.rb
  292. +32 −32 cookbooks/repo/definitions/{capistanize.rb → repo_capistranize.rb}
  293. +37 −0 cookbooks/repo/libraries/helper.rb
  294. +84 −142 cookbooks/repo/metadata.json
  295. +42 −62 cookbooks/repo/metadata.rb
  296. +6 −41 cookbooks/repo/recipes/default.rb
  297. +4 −3 cookbooks/repo/recipes/do_pull.rb
  298. +32 −33 cookbooks/repo/resources/default.rb
  299. +70 −0 cookbooks/repo_ftp/README.rdoc
  300. +34 −0 cookbooks/repo_ftp/metadata.json
Sorry, we could not display the entire diff because too many files (409) changed.
View
1 .gitignore
@@ -5,4 +5,5 @@
.DS_Store
.idea
.rake_test_cache
+Gemfile.lock
chefignoredoc
View
4 Gemfile
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+gem "chef"
+gem "foodcritic", :platforms => :ruby_19
+gem "rake"
View
33 README.rdoc
@@ -62,11 +62,11 @@ systems using ServerTemplates on the RightScale Cloud Management Platform.
[app]
RightScale application server management cookbook. This cookbook contains
- recipes that generally applicable to all application.
+ recipes that are generally applicable to all applications.
[app_passenger]
- Cookbook provides apache+passenger implementation of the app LWRP. Installs and
- configures, apache+passenger application server.
+ Cookbook provides an Apache + Passenger implementation of the 'app' Lightweight Resource Provider (LWRP). Installs and
+ configures an Apache + Passenger application server.
[app_php]
Cookbook provides Apache + PHP implementation of the app LWRP. Installs and
@@ -111,15 +111,15 @@ systems using ServerTemplates on the RightScale Cloud Management Platform.
[repo]
This cookbook provides abstract 'repo' resource for managing code download from
- Git, Subversion or Remote Object Store code repositories.
+ Git, Subversion or Remote Object Store (ROS) code repositories.
[repo_git]
Provides the Git implementation of the 'repo' resource to manage source code
download from Git repositories.
[repo_ros]
Provides the Remote Object Store implementation of the 'repo' resource to
- manage source code download from Remote Object Store repositories such as
+ manage the downloading of source code from Remote Object Store repositories such as
Amazon S3, Rackspace Cloud Files, and OpenStack Swift.
[repo_svn]
@@ -132,7 +132,7 @@ systems using ServerTemplates on the RightScale Cloud Management Platform.
[sys_dns]
This cookbook provides a set of dynamic DNS recipes used by RightScale
ServerTemplates including Database Manager ServerTemplates. Cookbook currently
- supports DNSMadeEasy, DynDns, and Amazon Route53 DNS service providers.
+ supports DNSMadeEasy, DynDns, CloudDNS, and Amazon Route53 DNS service providers.
[sys_firewall]
RightScale firewall cookbook. This cookbook provides a LWRP for managing access
@@ -223,8 +223,8 @@ the <tt>db_do_backup</tt> definition that uses a set of resources from the
In addition to housing reusable recipe snippets used within the cookbook, we also
use definitions as external methods that other cookbooks can call. For example,
-rightscale_logrotate_app which allows other cookbooks to add their logrotate
-configurations while deferring details of logrotate to the rightscale cookbook.
+<tt>rightscale_logrotate_app</tt> which allows other cookbooks to add their logrotate
+configurations while deferring details of logrotate to the <tt>rightscale</tt> cookbook.
In the RightScale cookbooks, definitions are named with the cookbook name as a
prefix so you can easily find which cookbook a definition comes from (for
@@ -270,10 +270,25 @@ cannot be achieved using the inputs or in your own cookbooks, you can use a
cookbook override. For more information see {Override Chef
Cookbooks}[http://support.rightscale.com/12-Guides/Chef_Cookbooks_Developer_Guide/08-Chef_Development/Override_Chef_Cookbooks].
+== DEVELOPMENT:
+
+The dependencies for working with the RightScale Cookbooks can be installed with Bundler:
+
+ bundle install
+
+=== Rake Tasks:
+
+* There are several Rake tasks to check the cookbooks with {Foodcritic}[http://acrmp.github.com/foodcritic/]
+ (Foodcritic currently only works with Ruby 1.9.2 and higher):
+
+ * <tt>foodcritic</tt> Runs Foodcritic with the standard suite of rules
+ * <tt>foodcritic_correctness</tt> Runs Foodcritic with just the correctness rules
+ * <tt>foodcritic_syntax</tt> Runs Foodcritic with just the syntax rules
+
== CONTRIBUTING:
Contributors to the RightScale cookbooks need to agree to and sign the
-{RightScale Contributors Agreement}[https://rightscale.echosign.com/public/hostedForm?formid=3S3CC74X283IXC]
+{RightScale Contributors Agreement}[https://rightscale.echosign.com/public/hostedForm?formid=3SMKS95X3F5G3S]
before contributions will be accepted.
To contribute changes back to the RightScale cookbooks:
View
20 Rakefile
@@ -40,3 +40,23 @@ task :spell do
sh "aspell -x -c #{readme}"
end
end
+
+begin
+ require 'foodcritic'
+
+ FoodCritic::Rake::LintTask.new do |task|
+ task.files = File.join(Dir.pwd, 'cookbooks')
+ end
+
+ FoodCritic::Rake::LintTask.new(:foodcritic_correctness) do |task|
+ task.files = File.join(Dir.pwd, 'cookbooks')
+ task.options = {:tags => ['correctness']}
+ end
+
+ FoodCritic::Rake::LintTask.new(:foodcritic_syntax) do |task|
+ task.files = File.join(Dir.pwd, 'cookbooks')
+ task.options = {:tags => ['syntax']}
+ end
+rescue LoadError
+ # since foodcritic is not available for Ruby 1.8.7, don't try to load its rules if it is not available
+end
View
12 config/README_template.rdoc
@@ -16,7 +16,6 @@ section below.
This cookbook provides abstract 'repo' resource for managing code download from
GIT, SVN or ROS code repositories.
--------------
== REQUIREMENTS:
@@ -33,7 +32,6 @@ Replace this text with a description of cookbook requirements:
<tt>repo_ros</tt> cookbooks must be present in your cookbook repository ROS
implementation depends on the <tt>rightscale::install_tools</tt> recipe.
* Requires a virtual machine launched from a RightScale-managed RightImage.
--------------
== COOKBOOKS DEPENDENCIES:
@@ -48,7 +46,6 @@ Be sure to include a ticket number.
Currently only primary backups to Remote Object Storage (ROS) are supported for
KVM hypervisors (w-1234).
--------------
== SETUP/USAGE:
@@ -62,7 +59,6 @@ application server. When using a RightScale ServerTemplate, this will also
automatically add the common attributes to your ServerTemplate inputs. Set
'jdbc/ConnDB' as your datasource name to set up database connection with the
application server.
--------------
== DETAILS:
@@ -76,7 +72,6 @@ else that users need to know in order to properly use this cookbook.
This cookbook is intended to be used in conjunction with cookbooks that contain
Lightweight Providers which implement the <tt>repo</tt> interface. See the
RightScale repo_git cookbook for an example.
--------------
=== Attributes:
@@ -102,7 +97,6 @@ file.
processes to start. Default is 16.
* <tt>node[:apache][:prefork][:minspareservers]</tt> - minimum number of spare
server processes. Default 16.
--------------
=== Templates:
@@ -120,7 +114,6 @@ Add link to the production templates that use this cookbook.
Configuration for the server and server components used in the
<tt>chef-server::rubygems-install</tt> recipe.
--------------
=== Definitions:
@@ -158,7 +151,6 @@ Enable the ssl module, which also has a configuration template in
apache_module "ssl" do
conf true
end
--------------
=== Libraries-helpers:
@@ -186,7 +178,6 @@ Returns:
Raise:
<tt>RuntimeError::</tt> If nether a valid private nor public ip can be found
--------------
=== LWRPs:
@@ -219,9 +210,7 @@ http://support.rightscale.com/12-Guides/Chef_Cookbooks_Developer_Guide/08-Chef_D
Common attributes
<tt>:destination</tt> - Path to where project repo will be pulled
-
<tt>:repository</tt> - Repository Url
-
<tt>:revision</tt> - Remote repo Branch or revision
* Give provider usage examples.
@@ -258,7 +247,6 @@ This can be useful when decommissioning a running server that had previously
requested ports opened.
* All tag based actions are scoped to the deployment.
--------------
= LICENSE:
View
157 cookbooks/app/README.rdoc
@@ -2,21 +2,20 @@
== DESCRIPTION:
-RightScale application server management cookbook
+RightScale's cookbook for application server management.
-This cookbook contains recipes that generally applicable to all application
-servers.
+This is an abstract cookbook that defines the recipes and interface to
+application provider cookbooks. It is not a standalone cookbook and must be
+used in conjunction with an application provider cookbook (i.e.
+<tt>app_php</tt>, app_tomcat, app_passenger, app_django or a user created application
+provider).
-Initialized App resource and its actions cover default set of operations,
-required for typical application server setup.
-
-More detailed info you can find in app::* recipes description.
+More detailed information can be found in the descriptions for each recipe in the cookbook. <tt>app::*</tt>.
== REQUIREMENTS:
* Requires a VM launched from a RightScale managed RightImage
-
-* Corresponding app providers cookbooks
+* Requires a corresponding app provider cookbook
== COOKBOOKS DEPENDENCIES:
Please see <tt>metadata.rb</tt> file for the latest dependencies.
@@ -27,6 +26,7 @@ Please see <tt>metadata.rb</tt> file for the latest dependencies.
* <tt>app_php</tt>
* <tt>app_passenger</tt>
* <tt>app_tomcat</tt>
+* <tt>app_django</tt>
== KNOWN LIMITATIONS:
@@ -35,10 +35,10 @@ There are no known limitations.
== SETUP:
In order to use App resource, you must create corresponding providers in your
-app server cookbook. See for example <tt>app_passenger</tt>, <tt>app_php</tt> or
+app server cookbook. For examples, see <tt>app_passenger</tt>, <tt>app_php</tt>, <tt>app_django</tt> or
<tt>app_tomcat</tt> cookbooks.
-You must define app attributes which will be used in initialized
+You must define app attributes which will be used in the initialized
<tt>app[default]</tt> resource.
Required attributes:
@@ -53,161 +53,163 @@ Recommended:
node[:app][:database_name]
node[:app][:database_user]
node[:app][:database_password]
- node[:app][:database_sever_fqdn]
+ node[:app][:database_server_fqdn]
+ node[:app][:db_adapter]
+ node[:app][:module_dependencies]
+ node[:app][:user]
+ node[:app][:group]
-More detailed description of these attribute variables is located in resource
-file description.
+More detailed descriptions of these attribute variables is located in the resource
+file's description.
== USAGE:
-1. Add the default recipe to tag your server as an app server. This is used by
+1. Add the <tt>app_*::default</tt> recipe prior to the <tt>app::default</tt>
+ recipe to define the provider.
+2. Add the default recipe to tag your server as an appserver. This is used by
servers (like databases) to identify their clients.
-2. Add desired app::do_* recipes to your application server ServerTemplate
-3. Develop corresponding providers in your application server cookbook.
-4. Define required and recommended attributes in your application server
+3. Add desired <tt>app::do_*</tt> recipes to your application server
+ ServerTemplate.
+4. Develop corresponding providers in your application server's cookbook.
+5. Define required and recommended attributes in your application server's
cookbook attributes file.
== DETAILS:
=== General
-This cookbook is intended to be used in conjunction with cookbooks that contain
+
+This cookbook can only be used in conjunction with cookbooks that contain
Lightweight Providers which implement the 'app' interface. See the RightScale
-app_php cookbook for an example.
+<tt>app_php</tt> cookbook for an example.
-Note: <tt>app[default]</tt> resource uses "persist true" flag, which allow to
-save created resource and its attributes in memory for future use.
+Note: <tt>app[default]</tt> resource uses the "persist true" flag, which allows you to
+save the created resource and its attributes in memory for future use.
-This cookbook contains recipes, required to connect your instance to RightScale
-Load balancer ServerTemplate:
+This cookbook contains recipes that are required to connect your instance to RightScale's
+"Load Balancer" ServerTemplates:
* <tt>do_loadbalancers_allow</tt>
* <tt>do_loadbalancers_deny</tt>
* <tt>request_loadbalancer_allow</tt>
* <tt>request_loadbalancer_deny</tt>
-For more info please see: {Load Balancer Setups}[http://support.rightscale.com/03-Tutorials/02-AWS/02-Website_Edition/2.5_Load_Balancer_Setups].
+For more info please see: {Load Balancer Setups}[http://support.rightscale.com/03-Tutorials/HAProxy_Load_Balancer_Server_Setup].
=== Attributes:
* <tt>node[:app][:provider]</tt> - Set a default provider.
* <tt>node[:app][:port]</tt> - Set a default port to listen on. Default: 8000
-* <tt>node[:app][:ip]</tt> - Ip to listen on. Default: First private IP
+* <tt>node[:app][:ip]</tt> - IP to listen on. Default: First private IP
+* <tt>node[:app][:user]</tt> - Application server user. Required for changing owner of created project dirs.
+* <tt>node[:app][:group]</tt> - Application server group. Required for changing owner of created project dirs.
=== Definitions:
<b>app_add_listen_port</b>
-Adds a port to the apache listen ports.conf file and node attribute
+Adds a port to the apache listen 'ports.conf' file and node attribute.
-Create node[:apache][:listen_ports] - array of strings for the web server to listen on.
+Create <tt>node[:apache][:listen_ports]</tt> - array of strings for the web server to listen on.
-This definition created specifically for the apache2 cookbook at this time.
+This definition created specifically for the <tt>apache2</tt> cookbook at this time.
===== Example:
app_add_listen_port php_port
-
=== Libraries-helpers:
===== RightScale::App::Helper.bind_ip(private_ips = [ ], public_ips = [ ])
-Return the IP address of the interface that this application server listens on.
+Returns the IP address of the interface that this application server will accept requests from
+on the specified listen ports.
<b>Parameters</b>
-* <tt>private_ips(Array)::</tt> List of private ips assigned to the application server
-* <tt>public_ips(Array)::</tt> List of public ips assigned to the application server
+* <tt>private_ips(Array)::</tt> List of private IP addresses assigned to the application server.
+* <tt>public_ips(Array)::</tt> List of public IP addresses assigned to the application server.
<b>Returns</b>
<tt>String::</tt> IP Address
<b>Raise</b>
-<tt>RuntimeError::</tt> If neither a valid private nor public ip can be found
-
+<tt>RuntimeError::</tt> If neither a valid private nor public IP address can be found.
===== RightScale::App::Helper.bind_port()
-Return the port that this application server listens on
+Return the port that this application server listens on.
<b>Returns</b>
<tt>node[:app][:port](integer)</tt> Port number
-
===== RightScale::App::Helper.vhosts(vhost_list)
-created to convert vhost names into array from a comma separated list
+Created to convert vhost names into an array from a comma-separated list.
<b>Parameters</b>
-<tt>vhost_list(Sting)::</tt> Comma separated list of virtual hosts
+<tt>vhost_list(Sting)::</tt> Comma-separated list of virtual hosts.
<b>Returns</b>
<tt>Array::</tt> Array of vhosts
-
=== LWRPs:
-This cookbook provides abstract <tt>app</tt> resource. Which will act as
-"interface" for corresponding Light Weight app_* providers.
+This cookbook provides the abstract <tt>app</tt> resource, which will act as
+an "interface" for corresponding Lightweight app_* providers.
-For now we have app_php, app_tomcat and app_passenger cookbooks. Each of them
-contain implementation of corresponding app__* Light Weight Provider which can
-be called using this resource.
+This includes <tt>app_php</tt>, <tt>app_tomcat</tt>, <tt>app_passenger</tt> and <tt>app_django</tt>
+cookbooks. Each of them contains an implementation of the corresponding app__*
+Lightweight Provider which can be called using this resource.
-Provider persisted in this cookbook will act as a cap if there will be no
-another app_ Light Weight Provider implementation. To avoid unexpected fails.
+To avoid unexpected failures, the Provider persisted in this cookbook will act as a
+cap if there is no other app_ Light Weight Provider implementation.
For more information about Lightweight Resources and Providers (LWRPs), please
-see: {Light Weight Resources and Providers (LWRP)}[http://support.rightscale.com/12-Guides/Chef_Cookbooks_Developer_Guide/08-Chef_Development/Lightweight_Resources_and_Providers_(LWRP)].
-
+see: {Lightweight Resources and Providers (LWRP)}[http://support.rightscale.com/12-Guides/Chef_Cookbooks_Developer_Guide/08-Chef_Development/Lightweight_Resources_and_Providers_(LWRP)].
===== App resource actions
-All actions declared in this resource intended to act as a templates to typical
-application server setup operations.
-
-* <tt>:install</tt> - Install packages required for application server setup
-* <tt>:setup_vhost</tt> - Action designed to setup APP LWRP with common
- parameters required for apache vhost file
-
-* <tt>:start</tt> - Action designed to setup user defined start sequence for
- application server.
-
-* <tt>:stop</tt> - Action designed to setup user defined stop sequence for
- application server.
-
-* <tt>:restart</tt> - Action designed to setup user defined restart sequence for
- application server.
+All actions declared in this resource are intended to act as templates to typical
+application server setup operations.
+* <tt>:install</tt> - Install packages required for application server setup.
+* <tt>:setup_vhost</tt> - Action designed to set up APP LWRP with common
+ parameters required for apache vhost file.
+* <tt>:start</tt> - Action designed to set up a user defined start sequence for
+ the application server.
+* <tt>:stop</tt> - Action designed to set up a user defined stop sequence for
+ the application server.
+* <tt>:restart</tt> - Action designed to set up a user defined restart sequence for
+ the application server.
+* <tt>:reload</tt> - Action designed to set up a user defined reload sequence for
+ the application server.
* <tt>:code_update</tt> - Action designed to perform project source code
- update/download
-
+ update/download.
* <tt>:setup_db_connection</tt> - Action designed to perform database
- configuration file creation
-
-* <tt>:setup_monitoring</tt> - Action designed to install and setup of required
+ configuration file creation.
+* <tt>:setup_monitoring</tt> - Action designed to set up and install required
monitoring software.
-
===== App resource attributes
* <tt>packages</tt> - Set of installed packages
* <tt>root</tt> - Application root
* <tt>port</tt> - Application port
-* <tt>destination</tt> - Path to where project repo will be pulled
+* <tt>destination</tt> - The path on the instance where the application code will be placed
* <tt>database_name</tt> - Name of the required database
* <tt>database_user</tt> - Database user
* <tt>database_password</tt> - Database password
-* <tt>database_sever_fqdn</tt> - Database server fqdn
-
+* <tt>database_server_fqdn</tt> - Database server's fully qualified domain name (FQDN)
+* <tt>user</tt> - App user
+* <tt>group</tt> - Group the app user belongs to
===== Usage Examples:
-Only basic examples here. More detailed examples of this resource use can be
-found in the do_* and setup_* recipes in the cookbook.
+Below are a few basic examples. More detailed examples of this resource use can be
+found in the <tt>do_*</tt> and <tt>setup_*</tt> recipes in the cookbook.
app "default" do
persist true
@@ -220,7 +222,7 @@ found in the do_* and setup_* recipes in the cookbook.
database_name node[:app][:database_name]
database_user node[:app][:database_user]
database_password node[:app][:database_password]
- database_sever_fqdn node[:app][:database_sever_fqdn]
+ database_server_fqdn node[:app][:database_server_fqdn]
action :setup_db_connection
end
@@ -230,8 +232,7 @@ found in the do_* and setup_* recipes in the cookbook.
action :setup_vhost
end
-
-= LICENSE:
+== LICENSE:
Copyright RightScale, Inc. All rights reserved. All access and use subject to the
RightScale Terms of Service available at http://www.rightscale.com/terms.php and,
View
4 cookbooks/app/attributes/default.rb
@@ -13,3 +13,7 @@
# By default listen on the first private IP
# This is a set instead of set_unless to support start/stop when the IP changes.
set[:app][:ip] = node[:cloud][:private_ips][0]
+# IP addrs of loadbalancer requesting firewall ports to be opened to it
+set_unless[:app][:lb_ip] = ""
+# The database schema name the app server uses
+set_unless[:app][:database_name] = ""
View
10 cookbooks/app/libraries/helper.rb
@@ -37,11 +37,13 @@ def self.bind_port()
node[:app][:port].to_i
end
- # Returns array from a comma seperated list
+ # Returns array from a comma separated list
#
- # @return [Array<String>] Array of vhosts
- def vhosts(vhost_list)
- return vhost_list.gsub(/\s+/, "").split(",").uniq.each
+ # @param pool_list [String] Comma separated list of URIs or FQDNs to create HAProxy pools for. Example: "/serverid, /appsever, default"
+ #
+ # @return [Array<String>] Array of pools Example: ["_serverid", "_appsever", "default"]
+ def pool_names(pool_list)
+ pool_norm_name = pool_list.gsub(/\s+/, "").gsub(/[\/]/, "_").split(",").uniq
end
end
View
50 cookbooks/app/metadata.json
@@ -4,7 +4,9 @@
"app_php": ">= 0.0.0",
"app_tomcat": ">= 0.0.0",
"app_passenger": ">= 0.0.0",
+ "app_django": ">= 0.0.0",
"rightscale": ">= 0.0.0",
+ "db": ">= 0.0.0",
"sys_firewall": ">= 0.0.0"
},
"name": "app",
@@ -19,10 +21,25 @@
"default": "8000",
"type": "string",
"recipes": [
- "app::default"
+ "app::install_server",
+ "app::handle_loadbalancers_allow",
+ "app::handle_loadbalancers_deny"
],
- "display_name": "Application Listen Port",
- "description": "The port that the application service is listening on."
+ "description": "The port that the application service is listening on. Example: 8000",
+ "display_name": "Application Listen Port"
+ },
+ "app/database_name": {
+ "required": "required",
+ "calculated": false,
+ "choice": [
+
+ ],
+ "type": "string",
+ "recipes": [
+ "app::setup_db_connection"
+ ],
+ "description": "Enter the name of the database schema to which applications will connect to. The database schema should have been created when the initial database was first set up. This input will be used to set the application server's database configuration file so that applications can connect to the correct schema within the database. This input is also used for database dump backups in order to determine which schema will be backed up. Example: mydbschema",
+ "display_name": "Database Schema Name"
}
},
"license": "Copyright RightScale, Inc. All rights reserved.",
@@ -31,22 +48,25 @@
"platforms": {
},
"maintainer": "RightScale, Inc.",
- "long_description": "= RightScale App Cookbook\n\n== DESCRIPTION:\n\nRightScale application server management cookbook\n\nThis cookbook contains recipes that generally applicable to all application\nservers.\n\nInitialized App resource and its actions cover default set of operations, required for typical application server setup.\n\nMore detailed info you can find in app::* recipes description.\n\n== REQUIREMENTS:\n\nRequires a VM launched from a RightScale managed RightImage\n Corresponding app providers\n\n== SETUP:\n\nIn order to use App resource, you must create corresponding providers in your app server cookbook.\nSee for example app_passenger, app_php or app_tomcat cookbooks.\n\nYou must define app attributes which will be used in initialized app[default] resource\nRequired attributes:\n node[:app][:provider] = \"app_passenger\"\nRecommended:\n node[:app][:destination]\n node[:app][:port]\n node[:app][:root]\n node[:app][:database_name]\n node[:app][:database_user]\n node[:app][:database_password]\n node[:app][:database_sever_fqdn]\nMore detailed description of these attribute variables is located in resource file description.\n\n== USAGE:\n\n1. Add the default recipe to tag your server as an appserver. This is used by\n servers (like databases) to identify their clients.\n2. Add desired app::do_* recipes to your application server ServerTemplate\n3. Develop corresponding providers in your application server cookbook.\n4. Define required and recommended attributes in your application server cookbook attributes file.\n\n == DETAILS:\n\nNote: app[default] resource uses \"persist true\" flag, which allow to save created resource and its attributes in memory for future use.\n\n== KNOWN LIMITATIONS:\n\n1. node[:app][:provider] must be defined\n2. app::default recipe must be present in ServerTemplate boot section.\n\n= LICENSE\n\nCopyright RightScale, Inc. All rights reserved. All access and use subject to the\nRightScale Terms of Service available at http://www.rightscale.com/terms.php and,\nif applicable, other agreements such as a RightScale Master Subscription Agreement.\n",
- "version": "0.1.0",
+ "long_description": "= RightScale App Cookbook\n\n== DESCRIPTION:\n\nRightScale's cookbook for application server management.\n\nThis is an abstract cookbook that defines the recipes and interface to\napplication provider cookbooks. It is not a standalone cookbook and must be\nused in conjunction with an application provider cookbook (i.e.\n<tt>app_php</tt>, app_tomcat, app_passenger, app_django or a user created application\nprovider).\n\nMore detailed information can be found in the descriptions for each recipe in the cookbook. <tt>app::*</tt>.\n\n== REQUIREMENTS:\n\n* Requires a VM launched from a RightScale managed RightImage\n* Requires a corresponding app provider cookbook\n\n== COOKBOOKS DEPENDENCIES:\nPlease see <tt>metadata.rb</tt> file for the latest dependencies.\n\n* <tt>sys_firewall</tt>\n* <tt>rightscale</tt>\n* <tt>repo</tt>\n* <tt>app_php</tt>\n* <tt>app_passenger</tt>\n* <tt>app_tomcat</tt>\n* <tt>app_django</tt>\n\n== KNOWN LIMITATIONS:\n\nThere are no known limitations.\n\n== SETUP:\n\nIn order to use App resource, you must create corresponding providers in your\napp server cookbook. For examples, see <tt>app_passenger</tt>, <tt>app_php</tt>, <tt>app_django</tt> or\n<tt>app_tomcat</tt> cookbooks.\n\nYou must define app attributes which will be used in the initialized\n<tt>app[default]</tt> resource.\n\nRequired attributes:\n\n node[:app][:provider] = \"app_passenger\"\n\nRecommended:\n\n node[:app][:destination]\n node[:app][:port]\n node[:app][:root]\n node[:app][:database_name]\n node[:app][:database_user]\n node[:app][:database_password]\n node[:app][:database_server_fqdn]\n node[:app][:db_adapter]\n node[:app][:module_dependencies]\n node[:app][:user]\n node[:app][:group]\n\nMore detailed descriptions of these attribute variables is located in the resource\nfile's description.\n\n== USAGE:\n\n1. Add the <tt>app_*::default</tt> recipe prior to the <tt>app::default</tt>\n recipe to define the provider.\n2. Add the default recipe to tag your server as an appserver. This is used by\n servers (like databases) to identify their clients.\n3. Add desired <tt>app::do_*</tt> recipes to your application server\n ServerTemplate.\n4. Develop corresponding providers in your application server's cookbook.\n5. Define required and recommended attributes in your application server's\n cookbook attributes file.\n\n== DETAILS:\n\n=== General\nThis cookbook can only be used in conjunction with cookbooks that contain\nLightweight Providers which implement the 'app' interface. See the RightScale\n<tt>app_php</tt> cookbook for an example.\n\nNote: <tt>app[default]</tt> resource uses the \"persist true\" flag, which allows you to\nsave the created resource and its attributes in memory for future use.\n\nThis cookbook contains recipes that are required to connect your instance to RightScale's\n\"Load Balancer\" ServerTemplates:\n\n* <tt>do_loadbalancers_allow</tt>\n* <tt>do_loadbalancers_deny</tt>\n* <tt>request_loadbalancer_allow</tt>\n* <tt>request_loadbalancer_deny</tt>\n\nFor more info please see: {Load Balancer Setups}[http://support.rightscale.com/03-Tutorials/HAProxy_Load_Balancer_Server_Setup].\n\n=== Attributes:\n\n* <tt>node[:app][:provider]</tt> - Set a default provider.\n* <tt>node[:app][:port]</tt> - Set a default port to listen on. Default: 8000\n* <tt>node[:app][:ip]</tt> - IP to listen on. Default: First private IP\n* <tt>node[:app][:user]</tt> - Application server user. Required for changing owner of created project dirs.\n* <tt>node[:app][:group]</tt> - Application server group. Required for changing owner of created project dirs.\n\n=== Definitions:\n\n<b>app_add_listen_port</b>\nAdds a port to the apache listen 'ports.conf' file and node attribute.\n\nCreate <tt>node[:apache][:listen_ports]</tt> - array of strings for the web server to listen on.\n\nThis definition created specifically for the <tt>apache2</tt> cookbook at this time.\n\n===== Example:\n\n app_add_listen_port php_port\n\n\n=== Libraries-helpers:\n\n===== RightScale::App::Helper.bind_ip(private_ips = [ ], public_ips = [ ])\n\nReturns the IP address of the interface that this application server will accept requests from\non the specified listen ports.\n\n<b>Parameters</b>\n\n* <tt>private_ips(Array)::</tt> List of private IP addresses assigned to the application server.\n* <tt>public_ips(Array)::</tt> List of public IP addresses assigned to the application server.\n\n<b>Returns</b>\n\n<tt>String::</tt> IP Address\n\n<b>Raise</b>\n\n<tt>RuntimeError::</tt> If neither a valid private nor public IP address can be found.\n\n\n===== RightScale::App::Helper.bind_port()\n\nReturn the port that this application server listens on.\n\n<b>Returns</b>\n\n<tt>node[:app][:port](integer)</tt> Port number\n\n\n===== RightScale::App::Helper.vhosts(vhost_list)\n\nCreated to convert vhost names into an array from a comma-separated list.\n\n<b>Parameters</b>\n\n<tt>vhost_list(Sting)::</tt> Comma-separated list of virtual hosts.\n\n<b>Returns</b>\n\n<tt>Array::</tt> Array of vhosts\n\n\n=== LWRPs:\n\nThis cookbook provides the abstract <tt>app</tt> resource, which will act as\nan \"interface\" for corresponding Lightweight app_* providers.\n\nThis includes <tt>app_php</tt>, <tt>app_tomcat</tt>, <tt>app_passenger</tt> and <tt>app_django</tt>\ncookbooks. Each of them contains an implementation of the corresponding app__*\nLightweight Provider which can be called using this resource.\n\nTo avoid unexpected failures, the Provider persisted in this cookbook will act as a \ncap if there is no other app_ Light Weight Provider implementation. \n\nFor more information about Lightweight Resources and Providers (LWRPs), please\nsee: {Lightweight Resources and Providers (LWRP)}[http://support.rightscale.com/12-Guides/Chef_Cookbooks_Developer_Guide/08-Chef_Development/Lightweight_Resources_and_Providers_(LWRP)].\n\n\n===== App resource actions\n\nAll actions declared in this resource are intended to act as templates to typical\napplication server setup operations.\n\n* <tt>:install</tt> - Install packages required for application server setup.\n\n* <tt>:setup_vhost</tt> - Action designed to set up APP LWRP with common\n parameters required for apache vhost file.\n\n* <tt>:start</tt> - Action designed to set up a user defined start sequence for\n the application server.\n\n* <tt>:stop</tt> - Action designed to set up a user defined stop sequence for\n the application server.\n\n* <tt>:restart</tt> - Action designed to set up a user defined restart sequence for\n the application server.\n\n* <tt>:reload</tt> - Action designed to set up a user defined reload sequence for\n the application server.\n\n* <tt>:code_update</tt> - Action designed to perform project source code\n update/download.\n\n* <tt>:setup_db_connection</tt> - Action designed to perform database\n configuration file creation.\n\n* <tt>:setup_monitoring</tt> - Action designed to set up and install required\n monitoring software.\n\n\n===== App resource attributes\n\n* <tt>packages</tt> - Set of installed packages\n* <tt>root</tt> - Application root\n* <tt>port</tt> - Application port\n* <tt>destination</tt> - The path on the instance where the application code will be placed\n* <tt>database_name</tt> - Name of the required database\n* <tt>database_user</tt> - Database user\n* <tt>database_password</tt> - Database password\n* <tt>database_server_fqdn</tt> - Database server's fully qualified domain name (FQDN)\n* <tt>user</tt> - App user\n* <tt>group</tt> - Group the app user belongs to\n\n===== Usage Examples:\nBelow are a few basic examples. More detailed examples of this resource use can be\nfound in the <tt>do_*</tt> and <tt>setup_*</tt> recipes in the cookbook.\n\n app \"default\" do\n persist true\n provider node[:app][:provider]\n packages node[:app][:packages]\n action :install\n end\n\n app \"default\" do\n database_name node[:app][:database_name]\n database_user node[:app][:database_user]\n database_password node[:app][:database_password]\n database_server_fqdn node[:app][:database_server_fqdn]\n action :setup_db_connection\n end\n\n app \"default\" do\n root node[:app][:root]\n port node[:app][:port].to_i\n action :setup_vhost\n end\n\n\n== LICENSE:\n\nCopyright RightScale, Inc. All rights reserved. All access and use subject to the\nRightScale Terms of Service available at http://www.rightscale.com/terms.php and,\nif applicable, other agreements such as a RightScale Master Subscription Agreement.\n",
+ "version": "13.2.0",
"recommendations": {
},
"recipes": {
- "app::setup_monitoring": "Install collectd monitoring. This recipe will call corresponding provider from app server cookbook, which will install and configure required monitoring software",
- "app::do_update_code": "Updates application source files from the remote repository. This recipe will call corresponding provider from app server cookbook, which will download/update application source code.",
- "app::request_loadbalancer_deny": "Sends a request to all application servers tagged with loadbalancer:app=<applistener_name> to deny connections from the server's private IP address. This script should be run on a load balancer after disconnecting application servers or upon decommissioning.",
- "app::default": "Adds the appserver:active=true, appserver:listen_ip=<ip> and appserver:listen_port=<port> tags to your server which identifies it as an application server and tells the load balancer what ip and port to connect to. For example, database servers will update its firewall port permissions to accept incoming requests from application servers with this tag.",
- "app::do_server_start": "Runs application server start sequence",
+ "app::handle_loadbalancers_allow": "Remote recipe run on app server from loadbalancer requesting access. DO NOT RUN.",
+ "app::setup_monitoring": "Install collectd monitoring. This recipe will call the corresponding provider from the app server cookbook, which installs and configures required monitoring software.",
+ "app::do_update_code": "Updates application source files from the remote repository. This recipe will call the corresponding provider from the app server cookbook, which will download/update application source code.",
+ "app::handle_loadbalancers_deny": "Remote recipe run on app server from loadbalancer revoking access. DO NOT RUN.",
+ "app::request_loadbalancer_deny": "Sends a request to all application servers tagged with loadbalancer:app=<applistener_name> to deny connections from the server's private IP address. This script should be run on a load balancer after disconnecting application servers or upon decommissioning.",
+ "app::install_server": "Adds the appserver:active=true, appserver:listen_ip=<ip> and appserver:listen_port=<port> tags to your server which identifies it as an application server and tells the load balancer what IP address and port to connect to. For example, a 'master' database server will update its firewall port permissions to accept incoming requests from application servers with this tag.",
+ "app::do_server_start": "Runs application server start sequence.",
"app::do_loadbalancers_allow": "Allows connections from all load balancers within a given listener pool which are tagged with loadbalancer:lb=<applistener_name>. This script should be run on an application server before it makes a request to be connected to the load balancers.",
- "app::setup_vhost": "Set up the application vhost on port 8000. This recipe will call corresponding provider from app server cookbook, which will create apache vhost file.",
- "app::request_loadbalancer_allow": "Sends a request to all application servers tagged with loadbalancer:app=<applistener_name> to allow connections from the server's private IP address. This script should be run on a load balancer before any application servers are attached to it.",
- "app::do_server_stop": "Runs application server stop sequence",
- "app::setup_db_connection": "Set up the database connection file. This recipe will call corresponding provider from app server cookbook, which will create application database configuration file.",
- "app::do_server_restart": "Runs application server restart sequence",
+ "app::do_server_reload": "Runs application server reload sequence.",
+ "app::setup_vhost": "Set up the application vhost on port 8000. This recipe will call the corresponding provider from the app server cookbook, which creates an apache vhost file.",
+ "app::request_loadbalancer_allow": "Sends a request to all application servers tagged with loadbalancer:app=<applistener_name> to allow connections from the server's private IP address. This script should be run on a load balancer before any application servers are attached to it.",
+ "app::do_server_stop": "Runs application server stop sequence.",
+ "app::setup_db_connection": "Set up the database connection file. This recipe will call the corresponding provider from app server cookbook, which creates an application database configuration file.",
+ "app::do_server_restart": "Runs application server restart sequence.",
"app::do_loadbalancers_deny": "Denies connections from all load balancers which are tagged with loadbalancer:lb=<applistener_name>. For example, you can run this script on an application server to deny connections from all load balancers within a given listener pool."
},
"groupings": {
View
48 cookbooks/app/metadata.rb
@@ -3,42 +3,64 @@
license "Copyright RightScale, Inc. All rights reserved."
description "Common utilities for RightScale managed application servers"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
-version "0.1"
+version "13.2.0"
+
+# supports "centos", "~> 5.8", "~> 6"
+# supports "redhat", "~> 5.8"
+# supports "ubuntu", "~> 10.04", "~> 12.04"
depends "sys_firewall"
depends "rightscale"
depends "repo"
depends "app_php"
depends "app_passenger"
depends "app_tomcat"
+depends "db"
+depends "app_django"
-recipe "app::default", "Adds the appserver:active=true, appserver:listen_ip=<ip> and appserver:listen_port=<port> tags to your server which identifies it as an application server and tells the load balancer what ip and port to connect to. For example, database servers will update its firewall port permissions to accept incoming requests from application servers with this tag."
+recipe "app::install_server", "Adds the appserver:active=true, appserver:listen_ip=<ip> and appserver:listen_port=<port> tags to your server which identifies it as an application server and tells the load balancer what IP address and port to connect to. For example, a 'master' database server will update its firewall port permissions to accept incoming requests from application servers with this tag."
recipe "app::do_loadbalancers_allow", "Allows connections from all load balancers within a given listener pool which are tagged with loadbalancer:lb=<applistener_name>. This script should be run on an application server before it makes a request to be connected to the load balancers."
recipe "app::do_loadbalancers_deny", "Denies connections from all load balancers which are tagged with loadbalancer:lb=<applistener_name>. For example, you can run this script on an application server to deny connections from all load balancers within a given listener pool."
-recipe "app::request_loadbalancer_allow", "Sends a request to all application servers tagged with loadbalancer:app=<applistener_name> to allow connections from the server's private IP address. This script should be run on a load balancer before any application servers are attached to it."
+recipe "app::request_loadbalancer_allow", "Sends a request to all application servers tagged with loadbalancer:app=<applistener_name> to allow connections from the server's private IP address. This script should be run on a load balancer before any application servers are attached to it."
+
+recipe "app::request_loadbalancer_deny", "Sends a request to all application servers tagged with loadbalancer:app=<applistener_name> to deny connections from the server's private IP address. This script should be run on a load balancer after disconnecting application servers or upon decommissioning."
+
+recipe "app::setup_vhost", "Set up the application vhost on port 8000. This recipe will call the corresponding provider from the app server cookbook, which creates an apache vhost file."
-recipe "app::request_loadbalancer_deny", "Sends a request to all application servers tagged with loadbalancer:app=<applistener_name> to deny connections from the server's private IP address. This script should be run on a load balancer after disconnecting application servers or upon decommissioning."
+recipe "app::setup_db_connection", "Set up the database connection file. This recipe will call the corresponding provider from app server cookbook, which creates an application database configuration file."
-recipe "app::setup_vhost", "Set up the application vhost on port 8000. This recipe will call corresponding provider from app server cookbook, which will create apache vhost file."
+recipe "app::do_update_code", "Updates application source files from the remote repository. This recipe will call the corresponding provider from the app server cookbook, which will download/update application source code."
-recipe "app::setup_db_connection", "Set up the database connection file. This recipe will call corresponding provider from app server cookbook, which will create application database configuration file."
+recipe "app::setup_monitoring", "Install collectd monitoring. This recipe will call the corresponding provider from the app server cookbook, which installs and configures required monitoring software."
-recipe "app::do_update_code", "Updates application source files from the remote repository. This recipe will call corresponding provider from app server cookbook, which will download/update application source code."
+recipe "app::do_server_start", "Runs application server start sequence."
-recipe "app::setup_monitoring", "Install collectd monitoring. This recipe will call corresponding provider from app server cookbook, which will install and configure required monitoring software"
+recipe "app::do_server_restart", "Runs application server restart sequence."
-recipe "app::do_server_start", "Runs application server start sequence"
+recipe "app::do_server_stop", "Runs application server stop sequence."
-recipe "app::do_server_restart", "Runs application server restart sequence"
+recipe "app::do_server_reload", "Runs application server reload sequence."
-recipe "app::do_server_stop", "Runs application server stop sequence"
+recipe "app::handle_loadbalancers_allow", "Remote recipe run on app server from loadbalancer requesting access. DO NOT RUN."
+
+recipe "app::handle_loadbalancers_deny", "Remote recipe run on app server from loadbalancer revoking access. DO NOT RUN."
attribute "app/port",
:display_name => "Application Listen Port",
- :description => "The port that the application service is listening on.",
+ :description => "The port that the application service is listening on. Example: 8000",
:default => "8000",
- :recipes => [ 'app::default' ],
+ :recipes => [
+ "app::install_server",
+ "app::handle_loadbalancers_allow",
+ "app::handle_loadbalancers_deny"
+ ],
:required => "optional"
+
+attribute "app/database_name",
+ :display_name => "Database Schema Name",
+ :description => "Enter the name of the database schema to which applications will connect to. The database schema should have been created when the initial database was first set up. This input will be used to set the application server's database configuration file so that applications can connect to the correct schema within the database. This input is also used for database dump backups in order to determine which schema will be backed up. Example: mydbschema",
+ :required => "required",
+ :recipes => ["app::setup_db_connection"]
View
14 cookbooks/app/providers/default.rb
@@ -26,10 +26,16 @@
end
+# Reload application
+action :reload do
+ raise 'Using "default" application provider. Action is not implemented'
+end
+
+
action :install do
# Install user-specified Packages and Modules
packages = new_resource.packages
- log "Packages which will be installed #{packages}"
+ log " Packages which will be installed #{packages}"
packages.each do |p|
package p
@@ -49,6 +55,12 @@
end
+# Set monitoring tools for application
+action :setup_monitoring do
+ raise 'Using "default" application provider. Action is not implemented'
+end
+
+
# Download/Update application repository
action :code_update do
raise 'Using "default" application provider. Action is not implemented'
View
5 cookbooks/app/recipes/do_loadbalancers_allow.rb
@@ -12,9 +12,10 @@ class Chef::Recipe
end
# Adding iptables rule to allow loadbalancers <-> application servers connections
-vhosts(node[:lb][:vhost_names]).each do | vhost_name |
+pool_names(node[:lb][:pools]).each do | pool_name |
+ # See cookbooks/sys_firewall/providers/default.rb for the "update" action.
sys_firewall "Open this appserver's ports to all loadbalancers" do
- machine_tag "loadbalancer:#{vhost_name}=lb"
+ machine_tag "loadbalancer:#{pool_name}=lb"
port node[:app][:port].to_i
enable true
action :update
View
5 cookbooks/app/recipes/do_loadbalancers_deny.rb
@@ -12,9 +12,10 @@ class Chef::Recipe
end
# Adding iptables rule to disable loadbalancers <-> application servers connections
-vhosts(node[:lb][:vhost_names]).each do | vhost_name |
+pool_names(node[:lb][:pools]).each do | pool_name |
+ # See cookbooks/sys_firewall/providers/default.rb for the "update" action.
sys_firewall "Close this appserver's ports to all loadbalancers" do
- machine_tag "loadbalancer:#{vhost_name}=lb"
+ machine_tag "loadbalancer:#{pool_name}=lb"
port node[:app][:port].to_i
enable false
action :update
View
16 cookbooks/app/recipes/do_server_reload.rb
@@ -0,0 +1,16 @@
+#
+# Cookbook Name:: app
+#
+# Copyright RightScale, Inc. All rights reserved. All access and use subject to the
+# RightScale Terms of Service available at http://www.rightscale.com/terms.php and,
+# if applicable, other agreements such as a RightScale Master Subscription Agreement.
+
+rightscale_marker :begin
+
+log " Reloading application server now..."
+# See cookbooks/app_<providers>/providers/default.rb for the "reload" action.
+app "default" do
+ action :reload
+end
+
+rightscale_marker :end
View
6 cookbooks/app/recipes/do_server_restart.rb
@@ -1,16 +1,14 @@
#
-# Cookbook Name::app
+# Cookbook Name:: app
#
# Copyright RightScale, Inc. All rights reserved. All access and use subject to the
# RightScale Terms of Service available at http://www.rightscale.com/terms.php and,
# if applicable, other agreements such as a RightScale Master Subscription Agreement.
-# This recipe will call "restart" action of "app" LightWeight resource
-# For more info please see "restart" action definition in connected LightWeight provider (ex. app_php/providers/default.rb)
-
rightscale_marker :begin
log " Restarting application server now..."
+# See cookbooks/app_<providers>/providers/default.rb for the "restart" action.
app "default" do
action :restart
end
View
6 cookbooks/app/recipes/do_server_start.rb
@@ -1,16 +1,14 @@
#
-# Cookbook Name::app
+# Cookbook Name:: app
#
# Copyright RightScale, Inc. All rights reserved. All access and use subject to the
# RightScale Terms of Service available at http://www.rightscale.com/terms.php and,
# if applicable, other agreements such as a RightScale Master Subscription Agreement.
-# This recipe will call "start" action of "app" LightWeight resource
-# For more info please see "start" action definition in connected LightWeight provider (ex. app_php/providers/default.rb)
-
rightscale_marker :begin
log " Starting application server now..."
+# See cookbooks/app_<providers>/providers/default.rb for the "start" action.
app "default" do
action :start
end
View
6 cookbooks/app/recipes/do_server_stop.rb
@@ -1,16 +1,14 @@
#
-# Cookbook Name::app
+# Cookbook Name:: app
#
# Copyright RightScale, Inc. All rights reserved. All access and use subject to the
# RightScale Terms of Service available at http://www.rightscale.com/terms.php and,
# if applicable, other agreements such as a RightScale Master Subscription Agreement.
-# This recipe will call "stop" action of "app" LightWeight resource
-# For more info please see "stop" action definition in connected LightWeight provider (ex. app_php/providers/default.rb)
-
rightscale_marker :begin
log " Stopping application server now..."
+# See cookbooks/app_<providers>/providers/default.rb for the "stop" action.
app "default" do
action :stop
end
View
6 cookbooks/app/recipes/do_update_code.rb
@@ -1,16 +1,14 @@
#
-# Cookbook Name::app
+# Cookbook Name:: app
#
# Copyright RightScale, Inc. All rights reserved. All access and use subject to the
# RightScale Terms of Service available at http://www.rightscale.com/terms.php and,
# if applicable, other agreements such as a RightScale Master Subscription Agreement.
-# This recipe will call "code_update" action of "app" LightWeight resource
-# For more info please see "code_update" action definition in connected LightWeight provider (ex. app_php/providers/default.rb)
-
rightscale_marker :begin
log " Updating project code repository"
+# See cookbooks/app_<providers>/providers/default.rb for the "code_update" action.
app "default" do
destination node[:app][:destination]
action :code_update
View
26 cookbooks/app/recipes/handle_loadbalancers_allow.rb
@@ -0,0 +1,26 @@
+#
+# Cookbook Name:: app
+#
+# Copyright RightScale, Inc. All rights reserved. All access and use subject to the
+# RightScale Terms of Service available at http://www.rightscale.com/terms.php and,
+# if applicable, other agreements such as a RightScale Master Subscription Agreement.
+
+# This recipe will setup firewall rules on the app server to allow loadbalancers to connect to the
+# correct port.
+
+rightscale_marker :begin
+
+# Setup attributes
+rule_ip = node[:app][:lb_ip]
+port = node[:app][:port]
+
+log " Adding firewall rules for loadbalancer to connect"
+# See cookbooks/sys_firewall/providers/default.rb for the "update" action.
+sys_firewall port do
+ ip_addr rule_ip
+ protocol "tcp"
+ enable true
+ action :update
+end
+
+rightscale_marker :end
View
26 cookbooks/app/recipes/handle_loadbalancers_deny.rb
@@ -0,0 +1,26 @@
+#
+# Cookbook Name:: app
+#
+# Copyright RightScale, Inc. All rights reserved. All access and use subject to the
+# RightScale Terms of Service available at http://www.rightscale.com/terms.php and,
+# if applicable, other agreements such as a RightScale Master Subscription Agreement.
+
+# This recipe will disable firewall rules on the app server that allowed loadbalancers to connect to the
+# correct port.
+
+rightscale_marker :begin
+
+# Setup attributes
+rule_ip = node[:app][:lb_ip]
+port = node[:app][:port]
+
+log " Removing firewall rules used to allow loadbalancer to connect"
+# See cookbooks/sys_firewall/providers/default.rb for the "update" action.
+sys_firewall port do
+ ip_addr rule_ip
+ protocol "tcp"
+ enable false
+ action :update
+end
+
+rightscale_marker :end
View
17 cookbooks/app/recipes/default.rb → cookbooks/app/recipes/install_server.rb
@@ -10,17 +10,34 @@
log " Provider is #{node[:app][:provider]}"
log " Application IP is #{node[:app][:ip]}"
log " Application port is #{node[:app][:port]}"
+
+# Setting app LWRP attribute
+node[:app][:destination] = "#{node[:repo][:default][:destination]}/#{node[:web_apache][:application_name]}"
+
+directory "#{node[:app][:destination]}" do
+ recursive true
+end
+
+
log " Installing #{node[:app][:packages]}" if node[:app][:packages]
# Setup default values for application resource and install required packages
+# See cookbooks/app_<providers>/providers/default.rb for the "install" action.
app "default" do
persist true
provider node[:app][:provider]
packages node[:app][:packages]
action :install
end
+if node[:app][:provider] == "app_passenger"
+ node[:app][:root] = node[:app][:destination] + "/public"
+else
+ node[:app][:root]="#{node[:app][:destination]}"
+end
+
# Let others know we are an appserver
+# See http://support.rightscale.com/12-Guides/Chef_Cookbooks_Developer_Guide/Chef_Resources#RightLinkTag for the "right_link_tag" resource.
right_link_tag "appserver:active=true"
right_link_tag "appserver:listen_ip=#{node[:app][:ip]}"
right_link_tag "appserver:listen_port=#{node[:app][:port]}"
View
17 cookbooks/app/recipes/request_loadbalancer_allow.rb
@@ -12,13 +12,16 @@ class Chef::Recipe
end
# Sending request to application servers, to add iptables rule, which will allow connection with loadbalancer
-vhosts(node[:lb][:vhost_names]).each do | vhost_name |
- sys_firewall "Request all appservers open ports to this loadbalancer" do
- machine_tag "loadbalancer:#{vhost_name}=app"
- port node[:app][:port].to_i
- enable true
- ip_addr node[:cloud][:private_ips][0]
- action :update_request
+
+attrs = {:app => Hash.new}
+attrs[:app][:lb_ip] = node[:cloud][:private_ips][0]
+
+pool_names(node[:lb][:pools]).each do | pool_name |
+ # See http://support.rightscale.com/12-Guides/Chef_Cookbooks_Developer_Guide/Chef_Resources#RemoteRecipe for the "remote_recipe" resource.
+ remote_recipe "Update app servers firewall" do
+ recipe "app::handle_loadbalancers_allow"
+ recipients_tags "loadbalancer:#{pool_name}=app"
+ attributes attrs
end
end
View
17 cookbooks/app/recipes/request_loadbalancer_deny.rb
@@ -11,14 +11,15 @@ class Chef::Recipe
include RightScale::App::Helper
end
-# Sending request to application servers, to disable iptables rule, which allows connection with loadbalancer
-vhosts(node[:lb][:vhost_names]).each do | vhost_name |
- sys_firewall "Request all appservers close ports to this loadbalancer" do
- machine_tag "loadbalancer:#{vhost_name}=app"
- port node[:app][:port].to_i
- enable false
- ip_addr node[:cloud][:private_ips][0]
- action :update_request
+attrs = {:app => Hash.new}
+attrs[:app][:lb_ip] = node[:cloud][:private_ips][0]
+
+pool_names(node[:lb][:pools]).each do | pool_name |
+ # See http://support.rightscale.com/12-Guides/Chef_Cookbooks_Developer_Guide/Chef_Resources#RemoteRecipe for the "remote_recipe" resource.
+ remote_recipe "Removing loadbalancers from app servers firewall" do
+ recipe "app::handle_loadbalancers_deny"
+ recipients_tags "loadbalancer:#{pool_name}=app"
+ attributes attrs
end
end
View
8 cookbooks/app/recipes/setup_db_connection.rb
@@ -1,21 +1,19 @@
#
-# Cookbook Name::app
+# Cookbook Name:: app
#
# Copyright RightScale, Inc. All rights reserved. All access and use subject to the
# RightScale Terms of Service available at http://www.rightscale.com/terms.php and,
# if applicable, other agreements such as a RightScale Master Subscription Agreement.
-# This recipe will call "setup_db_connection" action of "app" LightWeight resource
-# For more info please see "setup_db_connection" action definition in connected LightWeight provider (ex. app_php/providers/default.rb)
-
rightscale_marker :begin
log " Creating database config for application"
+# See cookbooks/app/providers/default.rb for the "setup_db_connection" action.
app "default" do
database_name node[:app][:database_name]
database_user node[:app][:database_user]
database_password node[:app][:database_password]
- database_sever_fqdn node[:app][:database_sever_fqdn]
+ database_server_fqdn node[:app][:database_server_fqdn]
action :setup_db_connection
end
View
6 cookbooks/app/recipes/setup_monitoring.rb
@@ -1,16 +1,14 @@
#
-# Cookbook Name::app
+# Cookbook Name:: app
#
# Copyright RightScale, Inc. All rights reserved. All access and use subject to the
# RightScale Terms of Service available at http://www.rightscale.com/terms.php and,
# if applicable, other agreements such as a RightScale Master Subscription Agreement.
-# This recipe will call "setup_monitoring" action of "app" LightWeight resource
-# For more info please see "setup_monitoring" action definition in connected LightWeight provider (ex. app_tomcat/providers/default.rb)
-
rightscale_marker :begin
log " Configuring monitoring for app server"
+# See cookbooks/app_<providers>/providers/default.rb for the "setup_monitoring" action.
app "default" do
action :setup_monitoring
end
View
7 cookbooks/app/recipes/setup_vhost.rb
@@ -1,5 +1,5 @@
#
-# Cookbook Name::app
+# Cookbook Name:: app
#
# Copyright RightScale, Inc. All rights reserved. All access and use subject to the
# RightScale Terms of Service available at http://www.rightscale.com/terms.php and,
@@ -10,7 +10,12 @@
rightscale_marker :begin
+# Include apache2 recipe for correct node values and providers initialization
+# in operational mode
+include_recipe "apache2"
+
log " Configuring vhost file for App server"
+# See cookbooks/app_<providers>/providers/default.rb for the "setup_vhost" action.
app "default" do
root node[:app][:root]
port node[:app][:port].to_i
View
9 cookbooks/app/resources/default.rb
@@ -9,7 +9,7 @@
# Install packages required for application server setup
actions :install
- # Set of installed packages
+ # Set of packages to be installed in addition to the base application packages.
attribute :packages, :kind_of => Array
# Set up the application vhost on specified port
@@ -30,6 +30,9 @@
# Runs application server restart sequence
actions :restart
+# Runs application server reload sequence
+actions :reload
+
# Updates application source files from the remote repository
# Action designed to setup APP LWRP with common parameters required for source code update/download
actions :code_update
@@ -42,12 +45,12 @@
actions :setup_db_connection
# Name of the required database
attribute :database_name, :kind_of => String
- # Database user
+ # Database username
attribute :database_user, :kind_of => String
# Database password
attribute :database_password, :kind_of => String
# Database server fqdn
- attribute :database_sever_fqdn, :kind_of => String
+ attribute :database_server_fqdn, :kind_of => String
# Action designed to setup APP LWRP with common parameters required for install and configuration of required monitoring software
actions :setup_monitoring
View
158 cookbooks/app_django/README.rdoc
@@ -0,0 +1,158 @@
+= RightScale App Django Cookbook
+
+== DESCRIPTION:
+
+* Cookbook provides Apache + Django implementation of the 'app' LWRP.
+* Installs and configures, Apache + Django application servers.
+
+== REQUIREMENTS:
+
+* Requires "app" Lightweight resource cookbook https://github.com/rightscale/rightscale_cookbooks/tree/master/cookbooks/app
+ or your own implementation of the "app" resource. See "app" cookbook README for details.
+* Requires a VM launched from a RightScale managed RightImage
+* Tested on CentOS 6.2 RightImage
+* Tested on Ubuntu 12.04 RightImage
+
+== COOKBOOKS DEPENDENCIES:
+
+Please see <tt>metadata.rb</tt> file for the latest dependencies.
+
+* <tt>rightscale</tt>
+* <tt>web_apache</tt>
+* <tt>repo</tt>
+* <tt>logrotate</tt>
+* <tt>app</tt>
+* <tt>db</tt>
+* <tt>python</tt>
+
+== KNOWN LIMITATIONS:
+
+There are no known limitations.
+
+== SETUP/USAGE:
+
+* Place <tt>app_django::setup_server_1_4</tt> recipe into your runlist to set
+ up the application server specific attributes. This sets up the app provider
+ and version.
+* Place <tt>app::install_server</tt> recipe after setup_server recipe to install
+ the application server.
+
+== DETAILS:
+
+=== General:
+
+The <tt>app_django</tt> cookbook will install and set up an Apache + Django
+application server configured to connect with a MySQL or Postgres database server.
+Set db/provider_type input in RightScale ServerTemplate to choose database
+provider. Place <tt>db::default</tt> recipe before application server installation
+to install the database client.
+
+<b>Apache</b>
+
+Server version: Apache/2.2.15
+
+Server built: Feb 13 2012 22:31:42
+
+<b>Django</b>
+
+Django version 1.4
+
+Python version 2.6.6 (2012-06-18) (x86_64-linux), Pip version 1.1
+
+also:
+* <tt>Custom python command input</tt>
+* <tt>Bundler support</tt>
+* <tt>Input for user defined python module installation</tt>
+* <tt>Application code installation from remote git, svn or Remote Object Store (ROS) location</tt>
+* <tt>MySQL or Postgres database connection file configuration</tt>
+* <tt>Automatic application vhost file configuration</tt>
+* <tt>Automatic logrotate file configuration for Apache logs</tt>
+
+For more info see: {Release Notes}[http://support.rightscale.com/18-Release_Notes/ServerTemplates_and_RightImages/current] (Section 'Django App Server' under ServerTemplates)
+
+Please checkout the tutorial: {Django App Server}[http://support.rightscale.com/03-Tutorials/Django_App_Server_Beta]
+
+ServerTemplate built on this cookbook can be combined in two modes:
+
+1 - For apps with bundler support, keep the "requirements.txt" file under application ROOT directory, and
+"run_custom_python_commands" for migration commands
+
+2 - For apps without bundler support, provide package(s) name as user input while server launch, and
+"run_custom_python_commands" for migration commands
+
+Note: In operational mode to install additional python packages for Django app server, provide package(s) name as user input
+and re-run the <tt>app::default</tt> boot recipe.
+
+Mix these recipes in any way to satisfy project requirements.
+
+=== Attributes:
+
+These are settings used in recipes and templates. Default values are noted.
+
+Note: Only "internal" cookbook attributes are described here. Descriptions of attributes which have inputs you can find in metadata.rb cookbook file.
+
+====== General attributes
+
+* <tt>node[:app_django][:module_dependencies]</tt> - Modules required for Apache.
+* <tt>node[:app_django][:app][:debug_mode]</tt> - Django application debug mode.
+* <tt>node[:app_django][:apache][:serve_local_files]</tt> - Used to enable/disable the serve of any existing local files.
+* <tt>node[:app_django][:deploy_dir]</tt> - Path in the specified repository where application code will be pulled from.
+* <tt>node[:app_django][:pip_bin]</tt> - Path to Python pip bin directory.
+* <tt>node[:app_django][:python_bin]</tt> - Path to Python bin directory.
+* <tt>node[:app_django][:project][:opt_pip_list]</tt> - A list of additional python packages, required for django application
+* <tt>node[:app_django][:project][:custom_cmd]</tt> - A list of python commands required for django application initialization.
+
+====== Platform dependent
+
+* <tt>node[:app_django][:apache][:log_dir]</tt> - Path to apache log directory.
+
+=== Templates:
+
+* <tt>apache_mod_wsgi_vhost.erb</tt> - Configuration for apache vhost file used in the <tt>app::setup_vhost</tt> recipe
+ and defined in <tt>:setup_vhost</tt> action of the <tt>app_django</tt> LWRP.
+* <tt>wsgi.py.erb</tt> - Configuration for Apache-Django WSGI config file used in the <tt>app::setup_vhost</tt> recipe
+ and defined in <tt>:setup_vhost</tt> action of the <tt>app_django</tt> LWRP.
+* <tt>settings.py.erb</tt> - Rename django "settings.py" file under app root to "settings_default.py", configure new "settings.py" file
+ for project database connection used in the <tt>app::setup_db_connection</tt> recipe
+ and defined in <tt>:setup_db_connection</tt> action of the <tt>app_django</tt> LWRP.
+
+=== LWRPs:
+
+<tt>app_django</tt> Lightweight provider is defined in the providers/default.rb file, it contains source for the following actions:
+
+* <tt>:install</tt>
+* <tt>:setup_vhost</tt>
+* <tt>:start</tt>
+* <tt>:stop</tt>
+* <tt>:restart</tt>
+* <tt>:reload</tt>
+* <tt>:code_update</tt>
+* <tt>:setup_db_connection</tt>
+
+For more info about these actions, please see the <tt>app</tt> cookbook README.
+
+For normal operations it requires "app" resource which will act as the interface to all <tt>app_django</tt> provider logic.
+
+===== Actions
+
+* <tt>:install</tt> - Install packages required for application server setup.
+* <tt>:setup_vhost</tt> - Set up apache vhost file with wsgi module directives included.
+* <tt>:start</tt> - Start sequence for Django application server.
+* <tt>:stop</tt> - Stop sequence for Django application server.
+* <tt>:reload</tt> - Reload sequence for Django application server.
+* <tt>:restart</tt> - Restart sequence for Django application server.
+* <tt>:code_update</tt> - Perform project source code update/download using user selected "repo" LWRP. Set up logrotate configuration.
+* <tt>:setup_db_connection</tt> - Perform project settings.py database connection configuration.
+ The driver type is specified as 'python' and the db_<provider> cookbook's
+ <tt>install_client_driver</tt> action performs necessary steps to install the
+ database adapter.
+
+===== Usage Example:
+
+For usage examples please see corresponding section in <tt>app</tt> cookbook README.
+
+== LICENSE:
+
+Copyright RightScale, Inc. All rights reserved. All access and use subject to the
+RightScale Terms of Service available at http://www.rightscale.com/terms.php and,
+if applicable, other agreements such as a RightScale Master Subscription Agreement.
View
36 cookbooks/app_django/attributes/default.rb
@@ -0,0 +1,36 @@
+#
+# Cookbook Name:: app_django
+#
+# Copyright RightScale, Inc. All rights reserved. All access and use subject to the
+# RightScale Terms of Service available at http://www.rightscale.com/terms.php and,
+# if applicable, other agreements such as a RightScale Master Subscription Agreement.
+
+
+# Setting Django version
+set[:app_django][:version] = "1.4"
+
+# Django application debug mode - https://docs.djangoproject.com/en/dev/ref/settings/#debug
+set_unless[:app_django][:app][:debug_mode] = "False"
+
+# By default apache will serve any existing local files directly (except actionable ones)
+set_unless[:app_django][:apache][:serve_local_files] = "true"
+# List of required apache modules
+set[:app][:module_dependencies] = ["proxy", "proxy_http"]
+
+
+# Defining apache user, group and log directory path depending on platform.
+case node[:platform]
+when "ubuntu"
+ set[:app_django][:apache][:log_dir] = "/var/log/apache2"
+when "centos", "redhat"
+ set[:app_django][:apache][:log_dir] = "/var/log/httpd"
+end
+
+# Path to PIP executable
+set[:app_django][:pip_bin] = "/usr/bin/pip"
+# Path to python executable
+set[:app_django][:python_bin] = "/usr/bin/python"
+# List of additional python packages, required for django application
+set_unless[:app_django][:project][:opt_pip_list] = ""
+# List of python commands required for django application initialization
+set_unless[:app_django][:project][:custom_cmd] = ""
View
96 cookbooks/app_django/metadata.json
@@ -0,0 +1,96 @@
+{
+ "dependencies": {
+ "repo": ">= 0.0.0",
+ "db_mysql": ">= 0.0.0",
+ "app": ">= 0.0.0",
+ "db_postgres": ">= 0.0.0",
+ "web_apache": ">= 0.0.0",
+ "python": ">= 0.0.0",
+ "rightscale": ">= 0.0.0"
+ },
+ "name": "app_django",
+ "maintainer_email": "support@rightscale.com",
+ "attributes": {
+ "app_django/project/custom_cmd": {
+ "required": "optional",
+ "calculated": false,
+ "choice": [
+
+ ],
+ "default": "",
+ "type": "string",
+ "recipes": [
+ "app_django::run_custom_django_commands"
+ ],
+ "display_name": "Custom Django command",
+ "description": "A comma-separated list of optional commands which will be executed in the app directory. Example: manage.py syncdb, manage.py migrate, manage.py loaddata ./fixtures/example_initial_data.json"
+ },
+ "app_django/project/opt_pip_list": {
+ "required": "optional",
+ "calculated": false,
+ "choice": [
+
+ ],
+ "default": "",
+ "type": "string",
+ "recipes": [
+ "app_django::setup_server_1_4"
+ ],
+ "display_name": "Custom Python Package list",
+ "description": "A space-separated list of optional python package(s), along with their versions in the Format: py-pkg1==version py-pkg2==version py-pkg3==version. Example: simplejson==1.7.1, Markdown==2.0.3"
+ },
+ "app_django/apache/serve_local_files": {
+ "required": "optional",
+ "calculated": false,
+ "choice": [
+ "true",
+ "false"
+ ],
+ "default": "true",
+ "type": "string",
+ "recipes": [
+ "app_django::setup_server_1_4"
+ ],
+ "display_name": "Apache serve local Files",
+ "description": "This option tells Apache whether it should serve the (static) content itself. Currently, it will omit PHP and TomCat dynamic content, such as *.php, *.action, *.jsp, and *.do Example: true"
+ },
+ "app_django/app/debug_mode": {
+ "required": "optional",
+ "calculated": false,
+ "choice": [
+ "true",
+ "false"
+ ],
+ "default": "false",
+ "type": "string",
+ "recipes": [
+ "app_django::setup_server_1_4"
+ ],
+ "display_name": "Django App Debug Mode",
+ "description": "Creates a Django application debug environment variable, e.g. should be true for dev and false for prod environment. Example: false"
+ }
+ },
+ "license": "Copyright RightScale, Inc. All rights reserved.",
+ "suggestions": {
+ },
+ "platforms": {
+ },
+ "maintainer": "RightScale, Inc.",
+ "long_description": "= RightScale App Django Cookbook\n\n== DESCRIPTION:\n\n* Cookbook provides Apache + Django implementation of the 'app' LWRP.\n* Installs and configures, Apache + Django application servers.\n\n== REQUIREMENTS:\n\n* Requires \"app\" Lightweight resource cookbook https://github.com/rightscale/rightscale_cookbooks/tree/master/cookbooks/app\n or your own implementation of the \"app\" resource. See \"app\" cookbook README for details.\n* Requires a VM launched from a RightScale managed RightImage\n* Tested on CentOS 6.2 RightImage\n* Tested on Ubuntu 12.04 RightImage\n\n== COOKBOOKS DEPENDENCIES:\n\nPlease see <tt>metadata.rb</tt> file for the latest dependencies.\n\n* <tt>rightscale</tt>\n* <tt>web_apache</tt>\n* <tt>repo</tt>\n* <tt>logrotate</tt>\n* <tt>app</tt>\n* <tt>db</tt>\n* <tt>python</tt>\n\n== KNOWN LIMITATIONS:\n\nThere are no known limitations.\n\n== SETUP/USAGE:\n\n* Place <tt>app_django::default</tt> recipe into your runlist to set up the application\n server. Since this sets up the app provider, it must be run before the\n <tt>app::default</tt> recipe, which expects a provider to already be set.\n* When using a RightScale ServerTemplate, this will also automatically add the\n common attributes to your ServerTemplate inputs.\n\n== DETAILS:\n\n=== General:\n\nThe <tt>app_django</tt> cookbook will install and set up an Apache + Django application server configured to connect with a MySQL or Postgres database server.\n\n<b>Apache</b>\n\nServer version: Apache/2.2.15\n\nServer built: Feb 13 2012 22:31:42\n\n<b>Django</b>\n\nDjango version 1.4\n\nPython version 2.6.6 (2012-06-18) (x86_64-linux), Pip version 1.1\n\nalso:\n* <tt>Custom python command input</tt>\n* <tt>Bundler support</tt>\n* <tt>Input for user defined python module installation</tt>\n* <tt>Application code installation from remote git, svn or Remote Object Store (ROS) location</tt>\n* <tt>MySQL or Postgres database connection file configuration</tt>\n* <tt>Automatic application vhost file configuration</tt>\n* <tt>Automatic logrotate file configuration for Apache logs</tt>\n\nFor more info see: {Release Notes}[http://support.rightscale.com/18-Release_Notes/ServerTemplates_and_RightImages/current] (Section 'Django App Server' under ServerTemplates)\n\nPlease checkout the tutorial: {Django App Server}[http://support.rightscale.com/03-Tutorials/Django_App_Server_Beta]\n\nServerTemplate built on this cookbook can be combined in two modes:\n\n1 - For apps with bundler support, keep the \"requirements.txt\" file under application ROOT directory, and\n\"run_custom_python_commands\" for migration commands\n\n2 - For apps without bundler support, provide package(s) name as user input while server launch, and\n\"run_custom_python_commands\" for migration commands\n\nNote: In operational mode to install additional python packages for Django app server, provide package(s) name as user input\nand re-run the <tt>app::default</tt> boot recipe.\n\nMix these recipes in any way to satisfy project requirements.\n\n=== Attributes:\nThese are settings used in recipes and templates. Default values are noted.\n\nNote: Only \"internal\" cookbook attributes are described here. Descriptions of attributes which have inputs you can find in metadata.rb cookbook file.\n\n====== General attributes\n* <tt>node[:app_django][:module_dependencies]</tt> - Modules required for Apache.\n* <tt>node[:app_django][:app][:debug_mode]</tt> - Django application debug mode.\n* <tt>node[:app_django][:apache][:serve_local_files]</tt> - Used to enable/disable the serve of any existing local files.\n* <tt>node[:app_django][:deploy_dir]</tt> - Path in the specified repository where application code will be pulled from.\n* <tt>node[:app_django][:pip_bin]</tt> - Path to Python pip bin directory.\n* <tt>node[:app_django][:python_bin]</tt> - Path to Python bin directory.\n* <tt>node[:app_django][:project][:opt_pip_list]</tt> - A list of additional python packages, required for django application\n* <tt>node[:app_django][:project][:custom_cmd]</tt> - A list of python commands required for django application initialization.\n\n====== Platform dependent\n* <tt>node[:app_django][:apache][:log_dir]</tt> - Path to apache log directory.\n\n=== Templates:\n\n* <tt>apache_mod_wsgi_vhost.erb</tt> - Configuration for apache vhost file used in the <tt>app::setup_vhost</tt> recipe\n and defined in <tt>:setup_vhost</tt> action of the <tt>app_django</tt> LWRP.\n* <tt>wsgi.py.erb</tt> - Configuration for Apache-Django WSGI config file used in the <tt>app::setup_vhost</tt> recipe\n and defined in <tt>:setup_vhost</tt> action of the <tt>app_django</tt> LWRP.\n* <tt>settings.py.erb</tt> - Rename django \"settings.py\" file under app root to \"settings_default.py\", configure new \"settings.py\" file\n for project database connection used in the <tt>app::setup_db_connection</tt> recipe\n and defined in <tt>:setup_db_connection</tt> action of the <tt>app_django</tt> LWRP.\n\n=== Definitions:\nnone\n\n=== Libraries-helpers:\nnone\n\n\n=== LWRPs:\n\n<tt>app_django</tt> Lightweight provider is defined in the providers/default.rb file, it contains source for the following actions:\n\n* <tt>:install</tt>\n\n* <tt>:setup_vhost</tt>\n\n* <tt>:start</tt>\n\n* <tt>:stop</tt>\n\n* <tt>:restart</tt>\n\n* <tt>:reload</tt>\n\n* <tt>:code_update</tt>\n\n* <tt>:setup_db_connection</tt>\n\nFor more info about these actions, please see the <tt>app</tt> cookbook README.\n\nFor normal operations it requires \"app\" resource which will act as the interface to all <tt>app_django</tt> provider logic.\n\n===== Actions\n\n* <tt>:install</tt> - Install packages required for application server setup.\n\n* <tt>:setup_vhost</tt> - Set up apache vhost file with wsgi module directives included.\n\n* <tt>:start</tt> - Start sequence for Django application server.\n\n* <tt>:stop</tt> - Stop sequence for Django application server.\n\n* <tt>:reload</tt> - Reload sequence for Django application server.\n\n* <tt>:restart</tt> - Restart sequence for Django application server.\n\n* <tt>:code_update</tt> - Perform project source code update/download using user selected \"repo\" LWRP. Set up logrotate configuration.\n\n* <tt>:setup_db_connection</tt> - Perform project settings.py database connection configuration.\n\n===== Usage Example:\n\nFor usage examples please see corresponding section in <tt>app</tt> cookbook README.\n\n== LICENSE:\n\nCopyright RightScale, Inc. All rights reserved. All access and use subject to the\nRightScale Terms of Service available at http://www.rightscale.com/terms.php and,\nif applicable, other agreements such as a RightScale Master Subscription Agreement.\n",
+ "version": "13.2.0",
+ "recommendations": {
+ },
+ "recipes": {
+ "app_django::run_custom_django_commands": "Run specific user defined commands. Commands will be executed in the app directory.",
+ "app_django::setup_server_1_4": "Installs the Django application server."
+ },
+ "groupings": {
+ },
+ "conflicting": {
+ },
+ "replacing": {
+ },
+ "description": "Installs the Django application server.",
+ "providing": {
+ }
+}
View
52 cookbooks/app_django/metadata.rb
@@ -0,0 +1,52 @@
+maintainer "RightScale, Inc."
+maintainer_email "support@rightscale.com"
+license "Copyright RightScale, Inc. All rights reserved."
+description "Installs the Django application server."
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
+version "13.2.0"
+
+# supports "centos", "~> 5.8", "~> 6.2"
+# supports "redhat", "~> 5.8"