motherbrain 0.0.0.placeholder → 0.13.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (259) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +9 -0
  5. data/CHANGELOG.md +196 -0
  6. data/COMMANDS.md +9 -0
  7. data/CONTRIBUTING.md +24 -0
  8. data/Dockerfile +26 -0
  9. data/Gemfile +60 -2
  10. data/Guardfile +30 -0
  11. data/LICENSE +10 -0
  12. data/MANIFESTS.md +90 -0
  13. data/OPERATORS_GUIDE.md +195 -0
  14. data/PLUGINS.md +268 -0
  15. data/README.md +304 -16
  16. data/Thorfile +123 -0
  17. data/VAGRANT.md +116 -0
  18. data/bin/boot +9 -0
  19. data/bin/mb +5 -0
  20. data/bin/mbsrv +5 -0
  21. data/config.json +32 -0
  22. data/features/cli/bootstrap_command/configurable_scripts.feature +32 -0
  23. data/features/cli/configure_command.feature +57 -0
  24. data/features/cli/environment_command/create_command.feature +22 -0
  25. data/features/cli/environment_command/destroy_command.feature +33 -0
  26. data/features/cli/environment_command/from_command.feature +29 -0
  27. data/features/cli/environment_command/list_command.feature +0 -0
  28. data/features/cli/node_limiting.feature +47 -0
  29. data/features/cli/plugin_command/list_command.feature +46 -0
  30. data/features/cli/service_command/service_command.feature +21 -0
  31. data/features/cli/template_command.feature +10 -0
  32. data/features/cli/validate_config.feature +46 -0
  33. data/features/step_definitions/bootstrap_steps.rb +57 -0
  34. data/features/step_definitions/chef_server_steps.rb +3 -0
  35. data/features/step_definitions/configuration_steps.rb +18 -0
  36. data/features/step_definitions/core_cli_steps.rb +33 -0
  37. data/features/step_definitions/environment_steps.rb +43 -0
  38. data/features/step_definitions/node_steps.rb +3 -0
  39. data/features/step_definitions/plugin_steps.rb +15 -0
  40. data/features/step_definitions/template_steps.rb +7 -0
  41. data/features/support/env.rb +68 -0
  42. data/lib/mb/api.rb +8 -0
  43. data/lib/mb/api/application.rb +7 -0
  44. data/lib/mb/api/endpoint.rb +5 -0
  45. data/lib/mb/api/helpers.rb +38 -0
  46. data/lib/mb/api/v1.rb +56 -0
  47. data/lib/mb/api/v1/config_endpoint.rb +12 -0
  48. data/lib/mb/api/v1/environments_endpoint.rb +174 -0
  49. data/lib/mb/api/v1/jobs_endpoint.rb +31 -0
  50. data/lib/mb/api/v1/plugins_endpoint.rb +90 -0
  51. data/lib/mb/api/validators.rb +5 -0
  52. data/lib/mb/api/validators/sem_ver.rb +18 -0
  53. data/lib/mb/application.rb +148 -0
  54. data/lib/mb/berkshelf.rb +50 -0
  55. data/lib/mb/bootstrap.rb +9 -0
  56. data/lib/mb/bootstrap/manager.rb +250 -0
  57. data/lib/mb/bootstrap/manifest.rb +131 -0
  58. data/lib/mb/bootstrap/routine.rb +199 -0
  59. data/lib/mb/bootstrap/template.rb +73 -0
  60. data/lib/mb/bootstrap/worker.rb +227 -0
  61. data/lib/mb/chef.rb +6 -0
  62. data/lib/mb/chef/config.rb +69 -0
  63. data/lib/mb/chef/run_list_item.rb +115 -0
  64. data/lib/mb/chef_mutex.rb +304 -0
  65. data/lib/mb/clean_room_base.rb +39 -0
  66. data/lib/mb/cli.rb +50 -0
  67. data/lib/mb/cli/base.rb +51 -0
  68. data/lib/mb/cli/shell.rb +29 -0
  69. data/lib/mb/cli/shell/basic.rb +11 -0
  70. data/lib/mb/cli/shell/color.rb +11 -0
  71. data/lib/mb/cli/shell/ext.rb +41 -0
  72. data/lib/mb/cli/sub_command.rb +95 -0
  73. data/lib/mb/cli/sub_command/component.rb +56 -0
  74. data/lib/mb/cli/sub_command/plugin.rb +232 -0
  75. data/lib/mb/cli_client.rb +178 -0
  76. data/lib/mb/cli_gateway.rb +426 -0
  77. data/lib/mb/cli_gateway/sub_commands.rb +3 -0
  78. data/lib/mb/cli_gateway/sub_commands/environment.rb +124 -0
  79. data/lib/mb/cli_gateway/sub_commands/plugin.rb +148 -0
  80. data/lib/mb/command.rb +88 -0
  81. data/lib/mb/command_invoker.rb +235 -0
  82. data/lib/mb/command_invoker/worker.rb +40 -0
  83. data/lib/mb/command_runner.rb +233 -0
  84. data/lib/mb/component.rb +245 -0
  85. data/lib/mb/config.rb +275 -0
  86. data/lib/mb/config_manager.rb +75 -0
  87. data/lib/mb/console.rb +35 -0
  88. data/lib/mb/cookbook_metadata.rb +73 -0
  89. data/lib/mb/core_ext.rb +3 -0
  90. data/lib/mb/core_ext/dir.rb +37 -0
  91. data/lib/mb/core_ext/enumerable.rb +48 -0
  92. data/lib/mb/core_ext/file.rb +24 -0
  93. data/lib/mb/core_ext/signal.rb +11 -0
  94. data/lib/mb/environment_manager.rb +195 -0
  95. data/lib/mb/error_handler.rb +212 -0
  96. data/lib/mb/errors.rb +693 -0
  97. data/lib/mb/file_system.rb +60 -0
  98. data/lib/mb/file_system/tempfile.rb +25 -0
  99. data/lib/mb/gear.rb +154 -0
  100. data/lib/mb/gears.rb +8 -0
  101. data/lib/mb/gears/dynamic_service.rb +218 -0
  102. data/lib/mb/gears/jmx.rb +24 -0
  103. data/lib/mb/gears/jmx/action.rb +46 -0
  104. data/lib/mb/gears/mysql.rb +20 -0
  105. data/lib/mb/gears/mysql/action.rb +190 -0
  106. data/lib/mb/gears/service.rb +163 -0
  107. data/lib/mb/gears/service/action.rb +58 -0
  108. data/lib/mb/gears/service/action_runner.rb +161 -0
  109. data/lib/mb/grape_ext.rb +3 -0
  110. data/lib/mb/grape_ext/endpoint.rb +13 -0
  111. data/lib/mb/group.rb +143 -0
  112. data/lib/mb/job.rb +183 -0
  113. data/lib/mb/job/state_machine.rb +34 -0
  114. data/lib/mb/job/states.rb +46 -0
  115. data/lib/mb/job_manager.rb +96 -0
  116. data/lib/mb/job_record.rb +67 -0
  117. data/lib/mb/job_ticket.rb +25 -0
  118. data/lib/mb/lock_manager.rb +116 -0
  119. data/lib/mb/logging.rb +134 -0
  120. data/lib/mb/logging/basic_format.rb +31 -0
  121. data/lib/mb/manifest.rb +128 -0
  122. data/lib/mb/mixin.rb +3 -0
  123. data/lib/mb/mixin/attribute_setting.rb +265 -0
  124. data/lib/mb/mixin/coded_exit.rb +49 -0
  125. data/lib/mb/mixin/locks.rb +54 -0
  126. data/lib/mb/mixin/services.rb +100 -0
  127. data/lib/mb/node_filter.rb +97 -0
  128. data/lib/mb/node_querier.rb +527 -0
  129. data/lib/mb/plugin.rb +300 -0
  130. data/lib/mb/plugin_manager.rb +589 -0
  131. data/lib/mb/provisioner.rb +186 -0
  132. data/lib/mb/provisioner/manager.rb +213 -0
  133. data/lib/mb/provisioner/manifest.rb +125 -0
  134. data/lib/mb/provisioner/provision_data.rb +96 -0
  135. data/lib/mb/provisioners.rb +5 -0
  136. data/lib/mb/provisioners/aws.rb +395 -0
  137. data/lib/mb/rest_gateway.rb +72 -0
  138. data/lib/mb/ridley_ext.rb +5 -0
  139. data/lib/mb/ridley_ext/cookbook_object.rb +15 -0
  140. data/lib/mb/srv_ctl.rb +183 -0
  141. data/lib/mb/test.rb +104 -0
  142. data/lib/mb/thor_ext.rb +49 -0
  143. data/lib/mb/upgrade.rb +6 -0
  144. data/lib/mb/upgrade/manager.rb +85 -0
  145. data/lib/mb/upgrade/worker.rb +149 -0
  146. data/lib/mb/version.rb +1 -1
  147. data/lib/motherbrain.rb +166 -2
  148. data/man/man_helper.rb +81 -0
  149. data/man/mb.1 +494 -0
  150. data/man/mb.1.html +300 -0
  151. data/man/mb.1.ronn.erb +62 -0
  152. data/motherbrain.gemspec +56 -20
  153. data/scripts/node_name.rb +14 -0
  154. data/spec/fixtures/cb_metadata.json +7 -0
  155. data/spec/fixtures/cb_metadata.rb +14 -0
  156. data/spec/fixtures/fake_id_rsa +27 -0
  157. data/spec/fixtures/fake_key.pem +27 -0
  158. data/spec/fixtures/myface-0.1.0/metadata.rb +14 -0
  159. data/spec/fixtures/myface-0.1.0/motherbrain.rb +0 -0
  160. data/spec/fixtures/test_env.json +15 -0
  161. data/spec/spec_helper.rb +67 -0
  162. data/spec/support/actor_mocking.rb +7 -0
  163. data/spec/support/berkshelf.rb +24 -0
  164. data/spec/support/chef_server.rb +102 -0
  165. data/spec/support/doubles.rb +11 -0
  166. data/spec/support/klass.rb +10 -0
  167. data/spec/support/matchers/each.rb +12 -0
  168. data/spec/support/matchers/error_codes.rb +5 -0
  169. data/spec/support/matchers/exit_codes.rb +57 -0
  170. data/spec/support/matchers/jobs.rb +11 -0
  171. data/spec/support/spec_helpers.rb +145 -0
  172. data/spec/unit/mb/api/application_spec.rb +11 -0
  173. data/spec/unit/mb/api/helpers_spec.rb +5 -0
  174. data/spec/unit/mb/api/v1/config_endpoint_spec.rb +19 -0
  175. data/spec/unit/mb/api/v1/environments_endpoint_spec.rb +71 -0
  176. data/spec/unit/mb/api/v1/jobs_endpoint_spec.rb +24 -0
  177. data/spec/unit/mb/api/v1/plugins_endpoint_spec.rb +298 -0
  178. data/spec/unit/mb/api/v1_spec.rb +37 -0
  179. data/spec/unit/mb/api/validators/sem_ver_spec.rb +5 -0
  180. data/spec/unit/mb/application_spec.rb +19 -0
  181. data/spec/unit/mb/berkshelf_spec.rb +38 -0
  182. data/spec/unit/mb/bootstrap/manager_spec.rb +347 -0
  183. data/spec/unit/mb/bootstrap/manifest_spec.rb +333 -0
  184. data/spec/unit/mb/bootstrap/routine_spec.rb +393 -0
  185. data/spec/unit/mb/bootstrap/template_spec.rb +100 -0
  186. data/spec/unit/mb/bootstrap/worker_spec.rb +194 -0
  187. data/spec/unit/mb/chef/config_spec.rb +33 -0
  188. data/spec/unit/mb/chef/run_list_item_spec.rb +34 -0
  189. data/spec/unit/mb/chef_mutex_spec.rb +314 -0
  190. data/spec/unit/mb/clean_room_base_spec.rb +31 -0
  191. data/spec/unit/mb/cli/base_spec.rb +43 -0
  192. data/spec/unit/mb/cli/shell/basic_spec.rb +5 -0
  193. data/spec/unit/mb/cli/shell/color_spec.rb +5 -0
  194. data/spec/unit/mb/cli/shell/ext_spec.rb +11 -0
  195. data/spec/unit/mb/cli/shell_spec.rb +38 -0
  196. data/spec/unit/mb/cli/sub_command/base_spec.rb +102 -0
  197. data/spec/unit/mb/cli/sub_command/component_spec.rb +5 -0
  198. data/spec/unit/mb/cli/sub_command/plugin_spec.rb +91 -0
  199. data/spec/unit/mb/cli/sub_command_spec.rb +43 -0
  200. data/spec/unit/mb/cli/ui.rb +0 -0
  201. data/spec/unit/mb/cli_client_spec.rb +51 -0
  202. data/spec/unit/mb/cli_gateway_spec.rb +386 -0
  203. data/spec/unit/mb/command_invoker/worker_spec.rb +43 -0
  204. data/spec/unit/mb/command_invoker_spec.rb +230 -0
  205. data/spec/unit/mb/command_runner_spec.rb +299 -0
  206. data/spec/unit/mb/command_spec.rb +76 -0
  207. data/spec/unit/mb/component_spec.rb +185 -0
  208. data/spec/unit/mb/config_manager_spec.rb +31 -0
  209. data/spec/unit/mb/config_spec.rb +408 -0
  210. data/spec/unit/mb/cookbook_metadata_spec.rb +89 -0
  211. data/spec/unit/mb/core_ext/dir_spec.rb +92 -0
  212. data/spec/unit/mb/core_ext/enumerable_spec.rb +104 -0
  213. data/spec/unit/mb/core_ext/file_spec.rb +58 -0
  214. data/spec/unit/mb/core_ext/signal_spec.rb +24 -0
  215. data/spec/unit/mb/environment_manager_spec.rb +166 -0
  216. data/spec/unit/mb/error_handler_spec.rb +173 -0
  217. data/spec/unit/mb/errors_spec.rb +132 -0
  218. data/spec/unit/mb/file_system/tempfile_spec.rb +14 -0
  219. data/spec/unit/mb/file_system_spec.rb +69 -0
  220. data/spec/unit/mb/gear_spec.rb +125 -0
  221. data/spec/unit/mb/gears/dynamic_service_spec.rb +187 -0
  222. data/spec/unit/mb/gears/jmx/action_spec.rb +34 -0
  223. data/spec/unit/mb/gears/jmx_spec.rb +32 -0
  224. data/spec/unit/mb/gears/mysql/action_spec.rb +118 -0
  225. data/spec/unit/mb/gears/mysql_spec.rb +21 -0
  226. data/spec/unit/mb/gears/service/action_runner_spec.rb +182 -0
  227. data/spec/unit/mb/gears/service/action_spec.rb +44 -0
  228. data/spec/unit/mb/gears/service_spec.rb +124 -0
  229. data/spec/unit/mb/group_spec.rb +280 -0
  230. data/spec/unit/mb/job_manager_spec.rb +56 -0
  231. data/spec/unit/mb/job_record_spec.rb +60 -0
  232. data/spec/unit/mb/job_spec.rb +201 -0
  233. data/spec/unit/mb/locks_manager_spec.rb +88 -0
  234. data/spec/unit/mb/logging_spec.rb +133 -0
  235. data/spec/unit/mb/manifest_spec.rb +105 -0
  236. data/spec/unit/mb/mixin/attribute_setting_spec.rb +180 -0
  237. data/spec/unit/mb/mixin/coded_exit_spec.rb +25 -0
  238. data/spec/unit/mb/mixin/locks_spec.rb +32 -0
  239. data/spec/unit/mb/mixin/services_spec.rb +75 -0
  240. data/spec/unit/mb/node_filter_spec.rb +86 -0
  241. data/spec/unit/mb/node_querier_spec.rb +532 -0
  242. data/spec/unit/mb/plugin_manager_spec.rb +724 -0
  243. data/spec/unit/mb/plugin_spec.rb +247 -0
  244. data/spec/unit/mb/provisioner/manager_spec.rb +141 -0
  245. data/spec/unit/mb/provisioner/manifest_spec.rb +182 -0
  246. data/spec/unit/mb/provisioner/provision_data_spec.rb +113 -0
  247. data/spec/unit/mb/provisioner_spec.rb +251 -0
  248. data/spec/unit/mb/provisioners/aws_spec.rb +392 -0
  249. data/spec/unit/mb/provisioners/environment_factory_spec.rb +108 -0
  250. data/spec/unit/mb/rest_gateway_spec.rb +13 -0
  251. data/spec/unit/mb/ridley_ext/cookbook_object_spec.rb +105 -0
  252. data/spec/unit/mb/srv_ctl_spec.rb +142 -0
  253. data/spec/unit/mb/upgrade/manager_spec.rb +37 -0
  254. data/spec/unit/mb/upgrade/worker_spec.rb +219 -0
  255. data/spec/unit/motherbrain_spec.rb +58 -0
  256. data/templates/bootstrap.json +8 -0
  257. data/templates/motherbrain.rb +44 -0
  258. metadata +694 -15
  259. data/Rakefile +0 -1
data/man/mb.1.html ADDED
@@ -0,0 +1,300 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
5
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
6
+ <title>mb(1) - command and control clusters of machines with Chef</title>
7
+ <style type='text/css' media='all'>
8
+ /* style: man */
9
+ body#manpage {margin:0}
10
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
11
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
12
+ .mp h2 {margin:10px 0 0 0}
13
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
14
+ .mp h3 {margin:0 0 0 4ex}
15
+ .mp dt {margin:0;clear:left}
16
+ .mp dt.flush {float:left;width:8ex}
17
+ .mp dd {margin:0 0 0 9ex}
18
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
19
+ .mp pre {margin-bottom:20px}
20
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
21
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
22
+ .mp img {display:block;margin:auto}
23
+ .mp h1.man-title {display:none}
24
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
25
+ .mp h2 {font-size:16px;line-height:1.25}
26
+ .mp h1 {font-size:20px;line-height:2}
27
+ .mp {text-align:justify;background:#fff}
28
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
29
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
30
+ .mp u {text-decoration:underline}
31
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
32
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
33
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
34
+ .mp b.man-ref {font-weight:normal;color:#434241}
35
+ .mp pre {padding:0 4ex}
36
+ .mp pre code {font-weight:normal;color:#434241}
37
+ .mp h2+pre,h3+pre {padding-left:0}
38
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
39
+ ol.man-decor {width:100%}
40
+ ol.man-decor li.tl {text-align:left}
41
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
42
+ ol.man-decor li.tr {text-align:right;float:right}
43
+ </style>
44
+ </head>
45
+ <!--
46
+ The following styles are deprecated and will be removed at some point:
47
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
48
+
49
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
50
+ .man-navigation should be used instead.
51
+ -->
52
+ <body id='manpage'>
53
+ <div class='mp' id='man'>
54
+
55
+ <div class='man-navigation' style='display:none'>
56
+ <a href="#NAME">NAME</a>
57
+ <a href="#SYNOPSIS">SYNOPSIS</a>
58
+ <a href="#DESCRIPTION">DESCRIPTION</a>
59
+ <a href="#FILES">FILES</a>
60
+ <a href="#OPTIONS">OPTIONS</a>
61
+ <a href="#COMMANDS">COMMANDS</a>
62
+ <a href="#COPYRIGHT">COPYRIGHT</a>
63
+ </div>
64
+
65
+ <ol class='man-decor man-head man head'>
66
+ <li class='tl'>mb(1)</li>
67
+ <li class='tc'></li>
68
+ <li class='tr'>mb(1)</li>
69
+ </ol>
70
+
71
+ <h2 id="NAME">NAME</h2>
72
+ <p class="man-name">
73
+ <code>mb</code> - <span class="man-whatis">command and control clusters of machines with Chef</span>
74
+ </p>
75
+
76
+ <h2 id="SYNOPSIS">SYNOPSIS</h2>
77
+
78
+ <p><code>mb</code> configure<br />
79
+ <code>mb</code> console<br />
80
+ <code>mb</code> purge HOST<br />
81
+ <code>mb</code> version<br />
82
+ <code>mb</code> template NAME PATH_OR_URL<br />
83
+ <code>mb</code> environment<br />
84
+ <code>mb</code> plugin<br />
85
+ <code>mb</code> <code>environment</code> configure ENVIRONMENT FILE<br />
86
+ <code>mb</code> <code>environment</code> destroy ENVIRONMENT<br />
87
+ <code>mb</code> <code>environment</code> list<br />
88
+ <code>mb</code> <code>environment</code> lock ENVIRONMENT<br />
89
+ <code>mb</code> <code>environment</code> unlock ENVIRONMENT<br />
90
+ <code>mb</code> <code>environment</code> create ENVIRONMENT<br />
91
+ <code>mb</code> <code>environment</code> help [COMMAND]<br />
92
+ <code>mb</code> <code>plugin</code> init [PATH]<br />
93
+ <code>mb</code> <code>plugin</code> install NAME<br />
94
+ <code>mb</code> <code>plugin</code> list<br />
95
+ <code>mb</code> <code>plugin</code> show NAME<br />
96
+ <code>mb</code> <code>plugin</code> uninstall NAME --version=VERSION<br />
97
+ <code>mb</code> <code>plugin</code> help [COMMAND]<br />
98
+ <code>mb</code> <code>&lt;plugin></code> nodes<br />
99
+ <code>mb</code> <code>&lt;plugin></code> bootstrap MANIFEST<br />
100
+ <code>mb</code> <code>&lt;plugin></code> provision MANIFEST<br />
101
+ <code>mb</code> <code>&lt;plugin></code> upgrade<br />
102
+ <code>mb</code> <code>&lt;plugin></code> <code>&lt;component></code> <code>&lt;command></code><br /></p>
103
+
104
+ <h2 id="DESCRIPTION">DESCRIPTION</h2>
105
+
106
+ <p>motherbrain is an orchestration framework for Chef. In the same way that you
107
+ would use Chef's Knife command to create a single node, you can use
108
+ motherbrain to create and control an entire application environment.</p>
109
+
110
+ <p>With the exception of a few top-level commands, most motherbrain
111
+ interactions use the commands defined in the selected plugin.</p>
112
+
113
+ <h2 id="FILES">FILES</h2>
114
+
115
+ <p>Provisioning and bootstrapping nodes require manifests. Insert
116
+ manifest documentation.</p>
117
+
118
+ <h2 id="OPTIONS">OPTIONS</h2>
119
+
120
+ <p>The following global options can be used on any motherbrain command to
121
+ change the behavior.</p>
122
+
123
+ <dl>
124
+ <dt><code>-c</code>, <code>--config</code></dt><dd><p>Path to a motherbrain JSON configuration file.</p></dd>
125
+ <dt><code>-v</code>, <code>--verbose</code></dt><dd><p>Increase verbosity of output.</p></dd>
126
+ <dt><code>-d</code>, <code>--debug</code></dt><dd><p>Output all log messages.</p></dd>
127
+ <dt><code>-L</code>, <code>--logfile</code></dt><dd><p>Set the log file location.</p></dd>
128
+ <dt><code>-p</code>, <code>--plugin_version</code></dt><dd><p>Plugin version to use</p></dd>
129
+ <dt><code>-e</code>, <code>--environment</code></dt><dd><p>Chef environment</p></dd>
130
+ <dt><code>--on_environment_missing</code></dt><dd><p>What to do when the environment doesn't exist
131
+ (Default: prompt)Possible values: prompt, create, quit</p></dd>
132
+ </dl>
133
+
134
+
135
+ <h2 id="COMMANDS">COMMANDS</h2>
136
+
137
+ <p><code>mb</code> configure<br />
138
+ create a new configuration file based on a set of interactive questions</p>
139
+
140
+ <dl>
141
+ <dt>-f, --force</dt><dd>create a new configuration file even if one already exists.<br /></dd>
142
+ </dl>
143
+
144
+
145
+ <p><code>mb</code> console<br />
146
+ Start an interactive motherbrain console</p>
147
+
148
+ <p><code>mb</code> purge HOST<br />
149
+ Remove Chef from node and purge it's data from the Chef server</p>
150
+
151
+ <dl>
152
+ <dt>--skip-chef</dt><dd>Skip removing the Chef installation from the node<br /></dd>
153
+ </dl>
154
+
155
+
156
+ <p><code>mb</code> version<br />
157
+ Display version and license information</p>
158
+
159
+ <p><code>mb</code> template NAME PATH_OR_URL<br />
160
+ Download and install a bootstrap template</p>
161
+
162
+ <p><code>mb</code> environment<br />
163
+ Environment level commands</p>
164
+
165
+ <p><code>mb</code> plugin<br />
166
+ Plugin level commands</p>
167
+
168
+ <p><code>mb</code> <code>environment</code> configure ENVIRONMENT FILE<br />
169
+ configure a Chef environment</p>
170
+
171
+ <dl>
172
+ <dt>-f, --force</dt><dd>perform the configuration even if the environment is locked<br /></dd>
173
+ </dl>
174
+
175
+
176
+ <p><code>mb</code> <code>environment</code> destroy ENVIRONMENT<br />
177
+ Destroy a provisioned environment</p>
178
+
179
+ <dl>
180
+ <dt>-y, --yes</dt><dd>Don't confirm, just destroy the environment<br /></dd>
181
+ <dt>-f, --force</dt><dd>Force destruction of a locked environment<br /></dd>
182
+ <dt>--provisioner=PROVISIONER</dt><dd>Provisioner to use for destroying the environment<br /></dd>
183
+ </dl>
184
+
185
+
186
+ <p><code>mb</code> <code>environment</code> list<br />
187
+ List all environments</p>
188
+
189
+ <p><code>mb</code> <code>environment</code> lock ENVIRONMENT<br />
190
+ Lock an environment</p>
191
+
192
+ <p><code>mb</code> <code>environment</code> unlock ENVIRONMENT<br />
193
+ Unlock an environment</p>
194
+
195
+ <p><code>mb</code> <code>environment</code> create ENVIRONMENT<br />
196
+ Create an empty environment</p>
197
+
198
+ <p><code>mb</code> <code>environment</code> help [COMMAND]<br />
199
+ Describe subcommands or one specific subcommand</p>
200
+
201
+ <p><code>mb</code> <code>plugin</code> init [PATH]<br />
202
+ Generate a new motherbrain plugin in the target cookbook</p>
203
+
204
+ <p><code>mb</code> <code>plugin</code> install NAME<br />
205
+ Install a plugin from the remote Chef server</p>
206
+
207
+ <dl>
208
+ <dt>--version=VERSION</dt><dd>The version of the plugin to install<br /></dd>
209
+ </dl>
210
+
211
+
212
+ <p><code>mb</code> <code>plugin</code> list<br />
213
+ List all installed plugins</p>
214
+
215
+ <dl>
216
+ <dt>--remote</dt><dd>search the remote Chef server and include plugins from the results<br /></dd>
217
+ </dl>
218
+
219
+
220
+ <p><code>mb</code> <code>plugin</code> show NAME<br />
221
+ Show information about a plugin</p>
222
+
223
+ <dl>
224
+ <dt>--version=VERSION</dt><dd>The version of the plugin to display information for<br /></dd>
225
+ <dt>--remote</dt><dd>Include plugins found on the remote Chef server<br /></dd>
226
+ </dl>
227
+
228
+
229
+ <p><code>mb</code> <code>plugin</code> uninstall NAME --version=VERSION<br />
230
+ Uninstall a plugin from your Berkshelf</p>
231
+
232
+ <dl>
233
+ <dt>--version=VERSION (REQUIRED)</dt><dd>The version of the plugin to install<br /></dd>
234
+ </dl>
235
+
236
+
237
+ <p><code>mb</code> <code>plugin</code> help [COMMAND]<br />
238
+ Describe subcommands or one specific subcommand</p>
239
+
240
+ <p><code>mb</code> <code>&lt;plugin></code> nodes<br />
241
+ List all nodes grouped by Component and Group</p>
242
+
243
+ <p><code>mb</code> <code>&lt;plugin></code> bootstrap MANIFEST<br />
244
+ Bootstrap a manifest of node groups</p>
245
+
246
+ <dl>
247
+ <dt>--chef-version=CHEF_VERSION</dt><dd>The version of Chef to bootstrap the node(s) with<br /></dd>
248
+ <dt>--components, --component-versions=key:value</dt><dd>The component versions to set with default attributes<br /></dd>
249
+ <dt>--cookbooks, --cookbook-versions=key:value</dt><dd>The cookbook versions to set on the environment<br /></dd>
250
+ <dt>--attributes, --environment-attributes=key:value</dt><dd>Any additional attributes to set on the environment<br /></dd>
251
+ <dt>--attributes-file, --environment-attributes-file=ENVIRONMENT_ATTRIBUTES_FILE</dt><dd>Any additional attributes to set on the environment via a json file.<br /></dd>
252
+ <dt>--template=TEMPLATE</dt><dd>Path to bootstrap template (ERB)<br /></dd>
253
+ <dt>-f, --force</dt><dd>Perform bootstrap even if the environment is locked<br /></dd>
254
+ </dl>
255
+
256
+
257
+ <p><code>mb</code> <code>&lt;plugin></code> provision MANIFEST<br />
258
+ Create a cluster of nodes and add them to a Chef environment</p>
259
+
260
+ <dl>
261
+ <dt>--chef-version=CHEF_VERSION</dt><dd>The version of Chef to bootstrap the node(s) with<br /></dd>
262
+ <dt>--components, --component-versions=key:value</dt><dd>The component versions to set with default attributes<br /></dd>
263
+ <dt>--cookbooks, --cookbook-versions=key:value</dt><dd>The cookbook versions to set on the environment<br /></dd>
264
+ <dt>--attributes, --environment-attributes=key:value</dt><dd>Any additional attributes to set on the environment<br /></dd>
265
+ <dt>--attributes-file, --environment-attributes-file=ENVIRONMENT_ATTRIBUTES_FILE</dt><dd>Any additional attributes to set on the environment via a json file.<br /></dd>
266
+ <dt>--skip-bootstrap</dt><dd>Nodes will be created and added to the Chef environment but not bootstrapped<br /></dd>
267
+ <dt>--template=TEMPLATE</dt><dd>Path to bootstrap template (ERB)<br /></dd>
268
+ <dt class="flush">--force</dt><dd>Perform bootstrap even if the environment is locked<br /></dd>
269
+ </dl>
270
+
271
+
272
+ <p><code>mb</code> <code>&lt;plugin></code> upgrade<br />
273
+ Upgrade an environment to the specified versions</p>
274
+
275
+ <dl>
276
+ <dt>--components, --component-versions=key:value</dt><dd>The component versions to set with default attributes<br /></dd>
277
+ <dt>--cookbooks, --cookbook-versions=key:value</dt><dd>The cookbook versions to set on the environment<br /></dd>
278
+ <dt>--attributes, --environment-attributes=key:value</dt><dd>Any additional attributes to set on the environment<br /></dd>
279
+ <dt>--attributes-file, --environment-attributes-file=ENVIRONMENT_ATTRIBUTES_FILE</dt><dd>Any additional attributes to set on the environment via a json file.<br /></dd>
280
+ <dt>-f, --force</dt><dd>Perform upgrade even if the environment is locked<br /></dd>
281
+ </dl>
282
+
283
+
284
+ <p><code>mb</code> <code>&lt;plugin></code> <code>&lt;component></code> <code>&lt;command></code><br />
285
+ Run a command defined in a component in the specified plugin. Options and usage are plugin-defined.</p>
286
+
287
+ <h2 id="COPYRIGHT">COPYRIGHT</h2>
288
+
289
+ <p>motherbrain is Copyright (C) 2012-2013 Riot Games, Inc.</p>
290
+
291
+
292
+ <ol class='man-decor man-foot man foot'>
293
+ <li class='tl'></li>
294
+ <li class='tc'>September 2013</li>
295
+ <li class='tr'>mb(1)</li>
296
+ </ol>
297
+
298
+ </div>
299
+ </body>
300
+ </html>
data/man/mb.1.ronn.erb ADDED
@@ -0,0 +1,62 @@
1
+ mb(1) -- command and control clusters of machines with Chef
2
+ ===========================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ <%- commands.each do |command| -%>
7
+ <%= command %><br>
8
+ <%- end -%>
9
+ `mb` `<plugin>` `<component>` `<command>`<br>
10
+
11
+ ## DESCRIPTION
12
+
13
+ motherbrain is an orchestration framework for Chef. In the same way that you
14
+ would use Chef's Knife command to create a single node, you can use
15
+ motherbrain to create and control an entire application environment.
16
+
17
+ With the exception of a few top-level commands, most motherbrain
18
+ interactions use the commands defined in the selected plugin.
19
+
20
+ ## FILES
21
+
22
+ Provisioning and bootstrapping nodes require manifests. Insert
23
+ manifest documentation.
24
+
25
+ ## OPTIONS
26
+
27
+ The following global options can be used on any motherbrain command to
28
+ change the behavior.
29
+
30
+ <%- class_options.each do |class_option| -%>
31
+ <%- opts = class_option[1].aliases + ["--#{class_option[0]}"] -%>
32
+ * <%= opts.collect {|x| "`#{x}`"}.join(", ") %>:
33
+ <%= class_option[1].description %>
34
+ <%- if class_option[1].show_default? -%>(Default: <%= class_option[1].default %>)<%- end -%>
35
+ <%- if class_option[1].enum -%>Possible values: <%= class_option[1].enum.join(', ') %><%- end -%>
36
+
37
+ <%- end -%>
38
+
39
+ ## COMMANDS
40
+
41
+ <%- extended_commands.each do |command| -%>
42
+ <%= command[0] %><br>
43
+ <%= command[1] %>
44
+ <%- if command[2] -%>
45
+ <br><%= command[2] %>
46
+ <%- end -%>
47
+
48
+ <%- command[3].each do |opt| -%>
49
+ * <%= opt[1].usage.gsub(/[\[\]]/,'') %><%= " (REQUIRED)" if opt[1].required? %>:
50
+ <%= opt[1].description %><br>
51
+ <%- if opt[1].show_default? -%><br>Default: <%= opt[1].default %><%- end -%>
52
+ <%- if opt[1].enum -%><br>Possible values: <%= opt[1].enum.join(', ') %><%- end -%>
53
+ <%- end -%>
54
+
55
+ <%- end -%>
56
+
57
+ `mb` `<plugin>` `<component>` `<command>`<br>
58
+ Run a command defined in a component in the specified plugin. Options and usage are plugin-defined.
59
+
60
+ ## COPYRIGHT
61
+
62
+ motherbrain is Copyright (C) 2012-2013 Riot Games, Inc.
data/motherbrain.gemspec CHANGED
@@ -1,24 +1,60 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'mb/version'
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/mb/version', __FILE__)
5
3
 
6
- Gem::Specification.new do |spec|
7
- spec.name = "motherbrain"
8
- spec.version = MotherBrain::VERSION
9
- spec.authors = ["Jamie Winsor"]
10
- spec.email = ["reset@riotgames.com"]
4
+ Gem::Specification.new do |s|
5
+ s.authors = [
6
+ "Jamie Winsor",
7
+ "Jesse Howarth",
8
+ "Justin Campbell",
9
+ "Michael Ivey",
10
+ "Cliff Dickerson",
11
+ "Andrew Garson",
12
+ "Kyle Allan",
13
+ "Josiah Kiehl",
14
+ ]
15
+ s.email = [
16
+ "jamie@vialstudios.com",
17
+ "jhowarth@riotgames.com",
18
+ "justin@justincampbell.me",
19
+ "michael.ivey@riotgames.com",
20
+ "cdickerson@riotgames.com",
21
+ "agarson@riotgames.com",
22
+ "kallan@riotgames.com",
23
+ "jkiehl@riotgames.com",
24
+ ]
25
+ s.description = %q{An orchestrator for Chef}
26
+ s.summary = s.description
27
+ s.homepage = "https://github.com/RiotGames/motherbrain"
28
+ s.license = "Apache 2.0"
11
29
 
12
- spec.description = %q{An orchestrator for Chef}
13
- spec.summary = spec.description
14
- spec.homepage = "https://github.com/RiotGames/motherbrain"
15
- spec.license = "Apache 2.0"
30
+ s.files = `git ls-files`.split($\)
31
+ s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
32
+ s.test_files = s.files.grep(%r{^(spec|features)/})
33
+ s.name = "motherbrain"
34
+ s.require_paths = ["lib"]
35
+ s.version = MotherBrain::VERSION
36
+ s.required_ruby_version = ">= 1.9.3"
16
37
 
17
- spec.files = `git ls-files`.split($\)
18
- spec.executables = spec.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
19
- spec.test_files = spec.files.grep(%r{^(spec|features)/})
20
- spec.name = "motherbrain"
21
- spec.require_paths = ["lib"]
22
- spec.version = MotherBrain::VERSION
23
- spec.required_ruby_version = ">= 1.9.3"
38
+ s.add_dependency 'celluloid', '~> 0.15'
39
+ # s.add_dependency 'dcell', '~> 0.14.0'
40
+ s.add_dependency 'reel', '~> 0.4.0'
41
+ s.add_dependency 'reel-rack'
42
+ s.add_dependency 'grape', '~> 0.6.0'
43
+ s.add_dependency 'net-ssh'
44
+ s.add_dependency 'net-sftp'
45
+ s.add_dependency 'solve', '>= 0.4.4'
46
+ s.add_dependency 'ridley-connectors', '~> 1.4.0'
47
+ s.add_dependency 'thor', '~> 0.18.0'
48
+ s.add_dependency 'faraday', '< 0.9.0'
49
+ s.add_dependency 'faraday_middleware'
50
+ s.add_dependency 'multi_json'
51
+ s.add_dependency 'fog', '~> 1.10.0'
52
+ s.add_dependency 'json', '>= 1.8.0'
53
+ s.add_dependency 'pry'
54
+ s.add_dependency 'pry-nav'
55
+ s.add_dependency 'buff-config', '~> 0.3'
56
+ s.add_dependency 'buff-extensions', '~> 0.5'
57
+ s.add_dependency 'buff-platform', '~> 0.1'
58
+ s.add_dependency 'buff-ruby_engine', '~> 0.1'
59
+ s.add_dependency 'grape-swagger', '~> 0.6.0'
24
60
  end
@@ -0,0 +1,14 @@
1
+ require "chef/client"
2
+ require 'rbconfig'
3
+
4
+ if File.exists?("/etc/chef/client.rb")
5
+ Chef::Config.from_file("/etc/chef/client.rb")
6
+ end
7
+ client = Chef::Client.new
8
+ if Ohai::Config[:file]
9
+ client.ohai.from_file(Ohai::Config[:file])
10
+ else
11
+ client.ohai.all_plugins
12
+ end
13
+ puts ""
14
+ puts client.node_name