TrueCar-chef 0.10.0.beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (372) hide show
  1. data/LICENSE +201 -0
  2. data/README.rdoc +171 -0
  3. data/bin/chef-client +26 -0
  4. data/bin/chef-solo +25 -0
  5. data/bin/knife +26 -0
  6. data/bin/shef +34 -0
  7. data/distro/README +2 -0
  8. data/distro/arch/etc/conf.d/chef-client.conf +5 -0
  9. data/distro/arch/etc/conf.d/chef-server-webui.conf +10 -0
  10. data/distro/arch/etc/conf.d/chef-server.conf +10 -0
  11. data/distro/arch/etc/conf.d/chef-solr-indexer.conf +8 -0
  12. data/distro/arch/etc/conf.d/chef-solr.conf +8 -0
  13. data/distro/arch/etc/rc.d/chef-client +76 -0
  14. data/distro/arch/etc/rc.d/chef-server +78 -0
  15. data/distro/arch/etc/rc.d/chef-server-webui +78 -0
  16. data/distro/arch/etc/rc.d/chef-solr +78 -0
  17. data/distro/arch/etc/rc.d/chef-solr-indexer +78 -0
  18. data/distro/common/man/man1/chef-indexer.1 +42 -0
  19. data/distro/common/man/man1/chef-server-webui.1 +106 -0
  20. data/distro/common/man/man1/chef-server.1 +107 -0
  21. data/distro/common/man/man1/chef-solr-indexer.1 +55 -0
  22. data/distro/common/man/man1/chef-solr.1 +55 -0
  23. data/distro/common/man/man8/chef-client.8 +63 -0
  24. data/distro/common/man/man8/chef-solo.8 +57 -0
  25. data/distro/common/man/man8/chef-solr-rebuild.8 +37 -0
  26. data/distro/common/man/man8/knife.8 +1349 -0
  27. data/distro/common/man/man8/shef.8 +45 -0
  28. data/distro/common/markdown/README +3 -0
  29. data/distro/common/markdown/knife.mkd +865 -0
  30. data/distro/debian/etc/default/chef-client +4 -0
  31. data/distro/debian/etc/default/chef-server +9 -0
  32. data/distro/debian/etc/default/chef-server-webui +9 -0
  33. data/distro/debian/etc/default/chef-solr +8 -0
  34. data/distro/debian/etc/default/chef-solr-indexer +7 -0
  35. data/distro/debian/etc/init.d/chef-client +175 -0
  36. data/distro/debian/etc/init.d/chef-server +122 -0
  37. data/distro/debian/etc/init.d/chef-server-webui +123 -0
  38. data/distro/debian/etc/init.d/chef-solr +176 -0
  39. data/distro/debian/etc/init.d/chef-solr-indexer +176 -0
  40. data/distro/debian/etc/init/chef-client.conf +17 -0
  41. data/distro/debian/etc/init/chef-server-webui.conf +17 -0
  42. data/distro/debian/etc/init/chef-server.conf +17 -0
  43. data/distro/debian/etc/init/chef-solr-indexer.conf +17 -0
  44. data/distro/debian/etc/init/chef-solr.conf +17 -0
  45. data/distro/redhat/etc/init.d/chef-client +106 -0
  46. data/distro/redhat/etc/init.d/chef-server +112 -0
  47. data/distro/redhat/etc/init.d/chef-server-webui +112 -0
  48. data/distro/redhat/etc/init.d/chef-solr +104 -0
  49. data/distro/redhat/etc/init.d/chef-solr-indexer +104 -0
  50. data/distro/redhat/etc/logrotate.d/chef-client +8 -0
  51. data/distro/redhat/etc/logrotate.d/chef-server +8 -0
  52. data/distro/redhat/etc/logrotate.d/chef-server-webui +8 -0
  53. data/distro/redhat/etc/logrotate.d/chef-solr +8 -0
  54. data/distro/redhat/etc/logrotate.d/chef-solr-indexer +8 -0
  55. data/distro/redhat/etc/sysconfig/chef-client +15 -0
  56. data/distro/redhat/etc/sysconfig/chef-server +14 -0
  57. data/distro/redhat/etc/sysconfig/chef-server-webui +14 -0
  58. data/distro/redhat/etc/sysconfig/chef-solr +8 -0
  59. data/distro/redhat/etc/sysconfig/chef-solr-indexer +7 -0
  60. data/lib/chef.rb +40 -0
  61. data/lib/chef/api_client.rb +264 -0
  62. data/lib/chef/application.rb +137 -0
  63. data/lib/chef/application/agent.rb +18 -0
  64. data/lib/chef/application/client.rb +242 -0
  65. data/lib/chef/application/knife.rb +169 -0
  66. data/lib/chef/application/solo.rb +217 -0
  67. data/lib/chef/applications.rb +4 -0
  68. data/lib/chef/certificate.rb +194 -0
  69. data/lib/chef/checksum.rb +182 -0
  70. data/lib/chef/checksum_cache.rb +189 -0
  71. data/lib/chef/client.rb +362 -0
  72. data/lib/chef/config.rb +244 -0
  73. data/lib/chef/cookbook/chefignore.rb +66 -0
  74. data/lib/chef/cookbook/cookbook_collection.rb +45 -0
  75. data/lib/chef/cookbook/cookbook_version_loader.rb +151 -0
  76. data/lib/chef/cookbook/file_system_file_vendor.rb +56 -0
  77. data/lib/chef/cookbook/file_vendor.rb +48 -0
  78. data/lib/chef/cookbook/metadata.rb +592 -0
  79. data/lib/chef/cookbook/remote_file_vendor.rb +87 -0
  80. data/lib/chef/cookbook/syntax_check.rb +136 -0
  81. data/lib/chef/cookbook_loader.rb +103 -0
  82. data/lib/chef/cookbook_site_streaming_uploader.rb +244 -0
  83. data/lib/chef/cookbook_uploader.rb +125 -0
  84. data/lib/chef/cookbook_version.rb +979 -0
  85. data/lib/chef/cookbook_version_selector.rb +163 -0
  86. data/lib/chef/couchdb.rb +247 -0
  87. data/lib/chef/daemon.rb +172 -0
  88. data/lib/chef/data_bag.rb +223 -0
  89. data/lib/chef/data_bag_item.rb +267 -0
  90. data/lib/chef/encrypted_data_bag_item.rb +126 -0
  91. data/lib/chef/environment.rb +386 -0
  92. data/lib/chef/exceptions.rb +153 -0
  93. data/lib/chef/file_access_control.rb +140 -0
  94. data/lib/chef/file_cache.rb +218 -0
  95. data/lib/chef/handler.rb +206 -0
  96. data/lib/chef/handler/json_file.rb +58 -0
  97. data/lib/chef/index_queue.rb +29 -0
  98. data/lib/chef/index_queue/amqp_client.rb +116 -0
  99. data/lib/chef/index_queue/consumer.rb +76 -0
  100. data/lib/chef/index_queue/indexable.rb +109 -0
  101. data/lib/chef/json_compat.rb +52 -0
  102. data/lib/chef/knife.rb +424 -0
  103. data/lib/chef/knife/bootstrap.rb +185 -0
  104. data/lib/chef/knife/bootstrap/archlinux-gems.erb +47 -0
  105. data/lib/chef/knife/bootstrap/centos5-gems.erb +41 -0
  106. data/lib/chef/knife/bootstrap/client-install.vbs +80 -0
  107. data/lib/chef/knife/bootstrap/fedora13-gems.erb +38 -0
  108. data/lib/chef/knife/bootstrap/ubuntu10.04-apt.erb +32 -0
  109. data/lib/chef/knife/bootstrap/ubuntu10.04-gems.erb +46 -0
  110. data/lib/chef/knife/bootstrap/windows-gems.erb +34 -0
  111. data/lib/chef/knife/client_bulk_delete.rb +43 -0
  112. data/lib/chef/knife/client_create.rb +73 -0
  113. data/lib/chef/knife/client_delete.rb +48 -0
  114. data/lib/chef/knife/client_edit.rb +48 -0
  115. data/lib/chef/knife/client_list.rb +43 -0
  116. data/lib/chef/knife/client_reregister.rb +59 -0
  117. data/lib/chef/knife/client_show.rb +53 -0
  118. data/lib/chef/knife/configure.rb +136 -0
  119. data/lib/chef/knife/configure_client.rb +52 -0
  120. data/lib/chef/knife/cookbook_bulk_delete.rb +61 -0
  121. data/lib/chef/knife/cookbook_create.rb +274 -0
  122. data/lib/chef/knife/cookbook_delete.rb +149 -0
  123. data/lib/chef/knife/cookbook_download.rb +134 -0
  124. data/lib/chef/knife/cookbook_list.rb +50 -0
  125. data/lib/chef/knife/cookbook_metadata.rb +102 -0
  126. data/lib/chef/knife/cookbook_metadata_from_file.rb +44 -0
  127. data/lib/chef/knife/cookbook_show.rb +101 -0
  128. data/lib/chef/knife/cookbook_site_download.rb +58 -0
  129. data/lib/chef/knife/cookbook_site_list.rb +56 -0
  130. data/lib/chef/knife/cookbook_site_search.rb +51 -0
  131. data/lib/chef/knife/cookbook_site_share.rb +114 -0
  132. data/lib/chef/knife/cookbook_site_show.rb +57 -0
  133. data/lib/chef/knife/cookbook_site_unshare.rb +56 -0
  134. data/lib/chef/knife/cookbook_site_vendor.rb +145 -0
  135. data/lib/chef/knife/cookbook_test.rb +82 -0
  136. data/lib/chef/knife/cookbook_upload.rb +146 -0
  137. data/lib/chef/knife/data_bag_create.rb +94 -0
  138. data/lib/chef/knife/data_bag_delete.rb +51 -0
  139. data/lib/chef/knife/data_bag_edit.rb +94 -0
  140. data/lib/chef/knife/data_bag_from_file.rb +85 -0
  141. data/lib/chef/knife/data_bag_list.rb +46 -0
  142. data/lib/chef/knife/data_bag_show.rb +81 -0
  143. data/lib/chef/knife/environment_create.rb +53 -0
  144. data/lib/chef/knife/environment_delete.rb +45 -0
  145. data/lib/chef/knife/environment_edit.rb +45 -0
  146. data/lib/chef/knife/environment_from_file.rb +39 -0
  147. data/lib/chef/knife/environment_list.rb +42 -0
  148. data/lib/chef/knife/environment_show.rb +46 -0
  149. data/lib/chef/knife/exec.rb +51 -0
  150. data/lib/chef/knife/index_rebuild.rb +50 -0
  151. data/lib/chef/knife/node_bulk_delete.rb +46 -0
  152. data/lib/chef/knife/node_create.rb +50 -0
  153. data/lib/chef/knife/node_delete.rb +47 -0
  154. data/lib/chef/knife/node_edit.rb +163 -0
  155. data/lib/chef/knife/node_from_file.rb +45 -0
  156. data/lib/chef/knife/node_list.rb +46 -0
  157. data/lib/chef/knife/node_run_list_add.rb +67 -0
  158. data/lib/chef/knife/node_run_list_remove.rb +48 -0
  159. data/lib/chef/knife/node_show.rb +62 -0
  160. data/lib/chef/knife/recipe_list.rb +33 -0
  161. data/lib/chef/knife/role_bulk_delete.rb +47 -0
  162. data/lib/chef/knife/role_create.rb +55 -0
  163. data/lib/chef/knife/role_delete.rb +47 -0
  164. data/lib/chef/knife/role_edit.rb +48 -0
  165. data/lib/chef/knife/role_from_file.rb +49 -0
  166. data/lib/chef/knife/role_list.rb +43 -0
  167. data/lib/chef/knife/role_show.rb +54 -0
  168. data/lib/chef/knife/search.rb +123 -0
  169. data/lib/chef/knife/ssh.rb +318 -0
  170. data/lib/chef/knife/status.rb +90 -0
  171. data/lib/chef/knife/subcommand_loader.rb +101 -0
  172. data/lib/chef/knife/tag_create.rb +31 -0
  173. data/lib/chef/knife/tag_delete.rb +31 -0
  174. data/lib/chef/knife/tag_list.rb +29 -0
  175. data/lib/chef/knife/ui.rb +227 -0
  176. data/lib/chef/knife/windows_bootstrap.rb +157 -0
  177. data/lib/chef/log.rb +39 -0
  178. data/lib/chef/mash.rb +211 -0
  179. data/lib/chef/mixin/check_helper.rb +31 -0
  180. data/lib/chef/mixin/checksum.rb +32 -0
  181. data/lib/chef/mixin/command.rb +221 -0
  182. data/lib/chef/mixin/command/unix.rb +215 -0
  183. data/lib/chef/mixin/command/windows.rb +76 -0
  184. data/lib/chef/mixin/convert_to_class_name.rb +63 -0
  185. data/lib/chef/mixin/create_path.rb +56 -0
  186. data/lib/chef/mixin/deep_merge.rb +225 -0
  187. data/lib/chef/mixin/deprecation.rb +65 -0
  188. data/lib/chef/mixin/from_file.rb +50 -0
  189. data/lib/chef/mixin/language.rb +165 -0
  190. data/lib/chef/mixin/language_include_attribute.rb +61 -0
  191. data/lib/chef/mixin/language_include_recipe.rb +52 -0
  192. data/lib/chef/mixin/params_validate.rb +225 -0
  193. data/lib/chef/mixin/recipe_definition_dsl_core.rb +81 -0
  194. data/lib/chef/mixin/shell_out.rb +40 -0
  195. data/lib/chef/mixin/template.rb +95 -0
  196. data/lib/chef/mixin/xml_escape.rb +140 -0
  197. data/lib/chef/mixins.rb +15 -0
  198. data/lib/chef/monkey_patches/dir.rb +36 -0
  199. data/lib/chef/monkey_patches/numeric.rb +7 -0
  200. data/lib/chef/monkey_patches/regexp.rb +34 -0
  201. data/lib/chef/monkey_patches/string.rb +28 -0
  202. data/lib/chef/monkey_patches/tempfile.rb +64 -0
  203. data/lib/chef/nil_argument.rb +3 -0
  204. data/lib/chef/node.rb +661 -0
  205. data/lib/chef/node/attribute.rb +487 -0
  206. data/lib/chef/openid_registration.rb +187 -0
  207. data/lib/chef/platform.rb +409 -0
  208. data/lib/chef/provider.rb +124 -0
  209. data/lib/chef/provider/breakpoint.rb +36 -0
  210. data/lib/chef/provider/cookbook_file.rb +101 -0
  211. data/lib/chef/provider/cron.rb +186 -0
  212. data/lib/chef/provider/cron/solaris.rb +195 -0
  213. data/lib/chef/provider/deploy.rb +320 -0
  214. data/lib/chef/provider/deploy/revision.rb +80 -0
  215. data/lib/chef/provider/deploy/timestamped.rb +33 -0
  216. data/lib/chef/provider/directory.rb +72 -0
  217. data/lib/chef/provider/env.rb +152 -0
  218. data/lib/chef/provider/env/windows.rb +75 -0
  219. data/lib/chef/provider/erl_call.rb +100 -0
  220. data/lib/chef/provider/execute.rb +60 -0
  221. data/lib/chef/provider/file.rb +222 -0
  222. data/lib/chef/provider/git.rb +221 -0
  223. data/lib/chef/provider/group.rb +133 -0
  224. data/lib/chef/provider/group/aix.rb +70 -0
  225. data/lib/chef/provider/group/dscl.rb +121 -0
  226. data/lib/chef/provider/group/gpasswd.rb +53 -0
  227. data/lib/chef/provider/group/groupadd.rb +81 -0
  228. data/lib/chef/provider/group/pw.rb +84 -0
  229. data/lib/chef/provider/group/usermod.rb +57 -0
  230. data/lib/chef/provider/group/windows.rb +79 -0
  231. data/lib/chef/provider/http_request.rb +122 -0
  232. data/lib/chef/provider/ifconfig.rb +132 -0
  233. data/lib/chef/provider/link.rb +161 -0
  234. data/lib/chef/provider/log.rb +54 -0
  235. data/lib/chef/provider/mdadm.rb +91 -0
  236. data/lib/chef/provider/mount.rb +117 -0
  237. data/lib/chef/provider/mount/mount.rb +232 -0
  238. data/lib/chef/provider/mount/windows.rb +80 -0
  239. data/lib/chef/provider/ohai.rb +41 -0
  240. data/lib/chef/provider/package.rb +160 -0
  241. data/lib/chef/provider/package/apt.rb +110 -0
  242. data/lib/chef/provider/package/dpkg.rb +112 -0
  243. data/lib/chef/provider/package/easy_install.rb +136 -0
  244. data/lib/chef/provider/package/freebsd.rb +123 -0
  245. data/lib/chef/provider/package/macports.rb +105 -0
  246. data/lib/chef/provider/package/pacman.rb +101 -0
  247. data/lib/chef/provider/package/portage.rb +135 -0
  248. data/lib/chef/provider/package/rpm.rb +101 -0
  249. data/lib/chef/provider/package/rubygems.rb +462 -0
  250. data/lib/chef/provider/package/solaris.rb +127 -0
  251. data/lib/chef/provider/package/yum-dump.py +128 -0
  252. data/lib/chef/provider/package/yum.rb +261 -0
  253. data/lib/chef/provider/package/zypper.rb +133 -0
  254. data/lib/chef/provider/remote_directory.rb +138 -0
  255. data/lib/chef/provider/remote_file.rb +119 -0
  256. data/lib/chef/provider/route.rb +195 -0
  257. data/lib/chef/provider/ruby_block.rb +33 -0
  258. data/lib/chef/provider/script.rb +55 -0
  259. data/lib/chef/provider/service.rb +128 -0
  260. data/lib/chef/provider/service/arch.rb +109 -0
  261. data/lib/chef/provider/service/debian.rb +130 -0
  262. data/lib/chef/provider/service/freebsd.rb +156 -0
  263. data/lib/chef/provider/service/gentoo.rb +54 -0
  264. data/lib/chef/provider/service/init.rb +71 -0
  265. data/lib/chef/provider/service/insserv.rb +52 -0
  266. data/lib/chef/provider/service/redhat.rb +60 -0
  267. data/lib/chef/provider/service/simple.rb +118 -0
  268. data/lib/chef/provider/service/solaris.rb +85 -0
  269. data/lib/chef/provider/service/upstart.rb +192 -0
  270. data/lib/chef/provider/service/windows.rb +146 -0
  271. data/lib/chef/provider/subversion.rb +194 -0
  272. data/lib/chef/provider/template.rb +105 -0
  273. data/lib/chef/provider/user.rb +187 -0
  274. data/lib/chef/provider/user/dscl.rb +280 -0
  275. data/lib/chef/provider/user/pw.rb +113 -0
  276. data/lib/chef/provider/user/useradd.rb +137 -0
  277. data/lib/chef/provider/user/windows.rb +124 -0
  278. data/lib/chef/providers.rb +93 -0
  279. data/lib/chef/recipe.rb +128 -0
  280. data/lib/chef/resource.rb +530 -0
  281. data/lib/chef/resource/apt_package.rb +34 -0
  282. data/lib/chef/resource/bash.rb +33 -0
  283. data/lib/chef/resource/breakpoint.rb +35 -0
  284. data/lib/chef/resource/cookbook_file.rb +45 -0
  285. data/lib/chef/resource/cron.rb +188 -0
  286. data/lib/chef/resource/csh.rb +33 -0
  287. data/lib/chef/resource/deploy.rb +371 -0
  288. data/lib/chef/resource/deploy_revision.rb +35 -0
  289. data/lib/chef/resource/directory.rb +76 -0
  290. data/lib/chef/resource/dpkg_package.rb +34 -0
  291. data/lib/chef/resource/easy_install_package.rb +57 -0
  292. data/lib/chef/resource/env.rb +58 -0
  293. data/lib/chef/resource/erl_call.rb +83 -0
  294. data/lib/chef/resource/execute.rb +127 -0
  295. data/lib/chef/resource/file.rb +99 -0
  296. data/lib/chef/resource/freebsd_package.rb +35 -0
  297. data/lib/chef/resource/gem_package.rb +53 -0
  298. data/lib/chef/resource/git.rb +37 -0
  299. data/lib/chef/resource/group.rb +70 -0
  300. data/lib/chef/resource/http_request.rb +61 -0
  301. data/lib/chef/resource/ifconfig.rb +134 -0
  302. data/lib/chef/resource/link.rb +78 -0
  303. data/lib/chef/resource/log.rb +62 -0
  304. data/lib/chef/resource/macports_package.rb +29 -0
  305. data/lib/chef/resource/mdadm.rb +82 -0
  306. data/lib/chef/resource/mount.rb +135 -0
  307. data/lib/chef/resource/ohai.rb +40 -0
  308. data/lib/chef/resource/package.rb +80 -0
  309. data/lib/chef/resource/pacman_package.rb +33 -0
  310. data/lib/chef/resource/perl.rb +33 -0
  311. data/lib/chef/resource/portage_package.rb +33 -0
  312. data/lib/chef/resource/python.rb +33 -0
  313. data/lib/chef/resource/remote_directory.rb +109 -0
  314. data/lib/chef/resource/remote_file.rb +83 -0
  315. data/lib/chef/resource/route.rb +135 -0
  316. data/lib/chef/resource/rpm_package.rb +34 -0
  317. data/lib/chef/resource/ruby.rb +33 -0
  318. data/lib/chef/resource/ruby_block.rb +40 -0
  319. data/lib/chef/resource/scm.rb +147 -0
  320. data/lib/chef/resource/script.rb +60 -0
  321. data/lib/chef/resource/service.rb +160 -0
  322. data/lib/chef/resource/solaris_package.rb +36 -0
  323. data/lib/chef/resource/subversion.rb +36 -0
  324. data/lib/chef/resource/template.rb +69 -0
  325. data/lib/chef/resource/timestamped_deploy.rb +31 -0
  326. data/lib/chef/resource/user.rb +130 -0
  327. data/lib/chef/resource/yum_package.rb +43 -0
  328. data/lib/chef/resource_collection.rb +217 -0
  329. data/lib/chef/resource_collection/stepable_iterator.rb +124 -0
  330. data/lib/chef/resource_definition.rb +67 -0
  331. data/lib/chef/resource_definition_list.rb +38 -0
  332. data/lib/chef/resources.rb +64 -0
  333. data/lib/chef/rest.rb +386 -0
  334. data/lib/chef/rest/auth_credentials.rb +71 -0
  335. data/lib/chef/rest/cookie_jar.rb +31 -0
  336. data/lib/chef/rest/rest_request.rb +188 -0
  337. data/lib/chef/role.rb +341 -0
  338. data/lib/chef/run_context.rb +126 -0
  339. data/lib/chef/run_list.rb +165 -0
  340. data/lib/chef/run_list/run_list_expansion.rb +193 -0
  341. data/lib/chef/run_list/run_list_item.rb +92 -0
  342. data/lib/chef/run_list/versioned_recipe_list.rb +68 -0
  343. data/lib/chef/run_status.rb +121 -0
  344. data/lib/chef/runner.rb +99 -0
  345. data/lib/chef/sandbox.rb +153 -0
  346. data/lib/chef/search/query.rb +65 -0
  347. data/lib/chef/shef.rb +326 -0
  348. data/lib/chef/shef/ext.rb +569 -0
  349. data/lib/chef/shef/model_wrapper.rb +120 -0
  350. data/lib/chef/shef/shef_rest.rb +28 -0
  351. data/lib/chef/shef/shef_session.rb +284 -0
  352. data/lib/chef/shell_out.rb +238 -0
  353. data/lib/chef/shell_out/unix.rb +223 -0
  354. data/lib/chef/shell_out/windows.rb +98 -0
  355. data/lib/chef/solr_query.rb +187 -0
  356. data/lib/chef/solr_query/lucene.treetop +150 -0
  357. data/lib/chef/solr_query/lucene_nodes.rb +285 -0
  358. data/lib/chef/solr_query/query_transform.rb +65 -0
  359. data/lib/chef/solr_query/solr_http_request.rb +118 -0
  360. data/lib/chef/streaming_cookbook_uploader.rb +201 -0
  361. data/lib/chef/tasks/chef_repo.rake +256 -0
  362. data/lib/chef/util/file_edit.rb +122 -0
  363. data/lib/chef/util/windows.rb +56 -0
  364. data/lib/chef/util/windows/net_group.rb +101 -0
  365. data/lib/chef/util/windows/net_use.rb +121 -0
  366. data/lib/chef/util/windows/net_user.rb +198 -0
  367. data/lib/chef/util/windows/volume.rb +59 -0
  368. data/lib/chef/version.rb +23 -0
  369. data/lib/chef/version_class.rb +70 -0
  370. data/lib/chef/version_constraint.rb +116 -0
  371. data/lib/chef/webui_user.rb +231 -0
  372. metadata +600 -0
@@ -0,0 +1,45 @@
1
+ .TH SHEF: "8" "March 2010" "Chef: 0.8.4" "System Administration Utilities"
2
+ .SH NAME
3
+ shef: \- Run Chef in an IRB session.
4
+ .SH SYNOPSIS
5
+ .B shef
6
+ \fI(options)\fR
7
+ .SH DESCRIPTION
8
+ .TP
9
+ This manual page documents shef, a command-line REPL console used to run Chef in an IRB session. It includes recipe and attribute file syntax, and interactive debugging features.
10
+ \fB\-S\fR, \fB\-\-server\fR CHEFSERVERURL
11
+ The chef server URL
12
+ .TP
13
+ \fB\-z\fR, \fB\-\-client\fR
14
+ chef\-client shef session
15
+ .TP
16
+ \fB\-c\fR, \fB\-\-config\fR CONFIG
17
+ The configuration file to use
18
+ .TP
19
+ \fB\-j\fR JSON_ATTRIBS
20
+ Load attributes from a JSON file or URL
21
+ .HP
22
+ \fB\-\-json\-attributes\fR
23
+ .TP
24
+ \fB\-s\fR, \fB\-\-solo\fR
25
+ chef\-solo shef session
26
+ .TP
27
+ \fB\-a\fR, \fB\-\-standalone\fR
28
+ standalone shef session
29
+ .TP
30
+ \fB\-v\fR, \fB\-\-version\fR
31
+ Show chef version
32
+ .TP
33
+ \fB\-h\fR, \fB\-\-help\fR
34
+ Show this message
35
+ .SH "SEE ALSO"
36
+ The full documentation for
37
+ .B shef
38
+ is maintained on the Chef wiki, http://wiki.opscode.com/display/chef/Shef/.
39
+ .SH AUTHOR
40
+ Shef was written by Daniel DeLeo <dan@kallistec.com> as part of Chef, by Opscode, Inc.
41
+ This manual page was written by Joshua Timberman <joshua@opscode.com> with help2man. Permission is granted
42
+ to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.
43
+ .PP
44
+ On Debian systems, the complete text of the Apache 2.0 License can be found in
45
+ /usr/share/common-licenses/Apache-2.0.
@@ -0,0 +1,3 @@
1
+ This directory contains markdown documentation that is used in other places.
2
+ For example, markdown (.mkd) documents that are generated as man pages
3
+ with ronn.
@@ -0,0 +1,865 @@
1
+ knife(8) -- Chef Server REST API utility
2
+ ========================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ __knife__ _sub-command_ _(options)_
7
+
8
+ ## DESCRIPTION
9
+
10
+ This manual page documents knife, a command-line utility used to interact with a Chef server directly through the RESTful API. Knife uses sub-commands to take various actions on different types of Chef objects. Some sub-commands take additional options. General options follow sub-commands and their options. A configuration file can be created for common defaults.
11
+
12
+ Unless otherwise specified, output is in JSON format, and input files are also JSON format.
13
+
14
+ The Chef class `Chef::Config` that configures the behavior of how knife runs has options that correspond to command-line options. These are noted as `Chef::Config` values.
15
+
16
+ ## GENERAL OPTIONS
17
+
18
+ * `-s`, `--server-url` URL:
19
+ Chef Server URL, corresponds to `Chef::Config` `chef_server_url`.
20
+ * `-k`, `--key` KEY:
21
+ API Client Key, corresponds to `Chef::Config` `client_key`.
22
+ * `-c`, `--config` CONFIG:
23
+ The configuration file to use
24
+ * `-e`, `--editor` EDITOR:
25
+ Set the editor to use for interactive commands
26
+ * `-F`, `--format` FORMAT:
27
+ Which format to use for output
28
+ * `-l`, `--log_level` LEVEL:
29
+ Set the log level (debug, info, warn, error, fatal), corresponds to `Chef::Config` `log_level`.
30
+ * `-L`, `--logfile` LOGLOCATION:
31
+ Set the log file location, defaults to STDOUT, corresponds to `Chef::Config` `log_location`.
32
+ * `-n`, `--no-editor`:
33
+ Do not open EDITOR, just accept the data as is
34
+ * `-u`, `--user` USER:
35
+ API Client Username, corresponds to `Chef::Config` `node_name`.
36
+ * `-p`, `--print-after`:
37
+ Show the data after a destructive operation
38
+ * `-v`, `--version`:
39
+ Show chef version
40
+ * `-y`, `--yes`:
41
+ Say yes to all prompts for confirmation
42
+ * `-h`, `--help`:
43
+ Show this message
44
+
45
+ Usage information for sub-commands can be displayed with `knife SUB-COMMAND --help`.
46
+
47
+ ## SUB-COMMANDS
48
+
49
+ Knife sub-commands are structured as _NOUN verb NOUN (options)_. The sub-commands are meant to be intuitively named. Because the Chef Server API is RESTful, sub-commands generally utilize CRUD operations.
50
+
51
+ * create (create)
52
+ * list and show (read)
53
+ * edit (update)
54
+ * delete (destroy)
55
+
56
+ Objects stored on the server support these, as described below.
57
+
58
+ ## GENERAL SUB-COMMANDS
59
+
60
+ The following are general sub-commands that do not fit within the other object types utilized in the Chef Server API.
61
+
62
+ __configure__ _(options)_
63
+
64
+ * `-i`, `--initial`:
65
+ Create an initial API Client
66
+ * `-r`, `--repository REPO`:
67
+ The path to your chef-repo
68
+
69
+ Create a configuration file for knife. This will prompt for values to enter into the file. Default values are listed in square brackets if no other entry is typed. See __CONFIGURATION__ below for available options.
70
+
71
+ __configure client DIRECTORY__
72
+
73
+ Read the `knife.rb` config file and generate a config file suitable for use in `/etc/chef/client.rb` and copy the validation certificate into the specified _DIRECTORY_.
74
+
75
+ __index rebuild__ _(options)_
76
+
77
+ * `-y`, `--yes`:
78
+ don't bother to ask if I'm sure
79
+
80
+ Rebuilds all the search indexes on the server.
81
+
82
+ __recipe list [PATTERN]__
83
+
84
+ List available recipes from the server. Specify _PATTERN_ as a regular expression to limit the results.
85
+
86
+ __search INDEX QUERY__ _(options)_
87
+
88
+ * `-a`, `--attribute ATTR`:
89
+ Show only one attribute
90
+ * `-i`, `--id-only`:
91
+ Show only the ID of matching objects
92
+ * `-R`, `--rows INT`:
93
+ The number of rows to return
94
+ * `-r`, `--run-list`:
95
+ Show only the run list
96
+ * `-o`, `--sort SORT`:
97
+ The order to sort the results in
98
+ * `-b`, `--start ROW`:
99
+ The row to start returning results at
100
+
101
+ Search indexes are a feature of the Chef Server and the search sub-command allows querying any of the available indexes using SOLR query syntax. The following data types are indexed for search: _node_, _role_, _client_, _data bag_.
102
+
103
+ __ssh QUERY COMMAND__ _(options)_
104
+
105
+ * `-a`, `--attribute ATTR `:
106
+ The attribute to use for opening the connection - default is fqdn
107
+ * `-C`, `--concurrency NUM `:
108
+ The number of concurrent connections
109
+ * `-m`, `--manual-list `:
110
+ QUERY is a space separated list of servers
111
+ * `-P`, `--ssh-password PASSWORD`:
112
+ The ssh password
113
+ * `-x`, `--ssh-user USERNAME `:
114
+ The ssh username
115
+
116
+ The _ssh_ sub-command opens an ssh session to each of the nodes in the search results of the _QUERY_. This sub-command requires that the net-ssh-multi and highline Ruby libraries are installed. On Debian systems, these are the libnet-ssh-multi-ruby and libhighline-ruby packages. They can also be installed as RubyGems (net-ssh-multi and highline, respectively).
117
+
118
+ __status__ _(options)_
119
+
120
+ * `-r`, `--run-list RUN_LIST`:
121
+ Show the run list
122
+
123
+ The _status_ sub-command searches the Chef Server for all nodes and displays information about the last time the node checked into the server and executed a `node.save`. The fields displayed are the relative checkin time, the node name, it's operating system platform and version, the fully-qualified domain name and the default IP address. If the `-r` option is given, the node's run list will also be displayed. Note that depending on the configuration of the nodes, the FQDN and IP displayed may not be publicly reachable.
124
+
125
+ ## BOOTSTRAP SUB-COMMANDS
126
+
127
+ __bootstrap FQDN__ _(options)_
128
+
129
+ * `-i`, `--identity-file IDENTITY_FILE`:
130
+ The SSH identity file used for authentication
131
+ * `-N`, `--node-name NAME`:
132
+ The Chef node name for your new node
133
+ * `-P`, `--ssh-password PASSWORD`:
134
+ The ssh password
135
+ * `-x`, `--ssh-user USERNAME`:
136
+ The ssh username
137
+ * `--prerelease`:
138
+ Install pre-release Chef gems
139
+ * `-r`, `--run-list RUN_LIST`:
140
+ Comma separated list of roles/recipes to apply
141
+ * `-P`, `--ssh-password PASSWORD`:
142
+ The ssh password
143
+ * `-x`, `--ssh-user USERNAME`:
144
+ The ssh username
145
+ * `--template-file TEMPLATE`:
146
+ Full path to location of template to use
147
+ * `--sudo`:
148
+ Execute the bootstrap via sudo
149
+ * `-d`, `--distro DISTRO`:
150
+ Bootstrap a distro using a template
151
+
152
+ Performs a Chef Bootstrap on the target node. The goal of the bootstrap is to get Chef installed on the target system so it can run Chef Client with a Chef Server. The main assumption is a baseline OS installation exists. This sub-command is used internally by some cloud computing server create commands and the others will be migrated in a future version of Chef.
153
+
154
+ As of Chef 0.9.8, the bootstrap sub-command supports supplying a template to perform the bootstrap steps. If the distro is not specified (via `-d` or `--distro` option), an Ubuntu 10.04 with RubyGems is assumed. The __DISTRO__ value corresponds to the base filename of the template, in other words `DISTRO`.erb. A template file can be specified with the `--template-file` option in which case the __DISTRO__ is not used. The sub-command looks in the following locations for the template to use:
155
+
156
+ * `bootstrap` directory in the installed Chef Knife library.
157
+ * `bootstrap` directory in the `$PWD/.chef`.
158
+ * `bootstrap` directory in the users `$HOME/.chef`.
159
+
160
+ The default bootstrap templates are scripts that get copied to the target node (FQDN). As of Chef 0.9.8, the following distros are supported:
161
+
162
+ * centos5-gems
163
+ * fedora13-gems
164
+ * ubuntu10.04-gems
165
+ * ubuntu10.04-apt
166
+
167
+ The gems installations will use RubyGems 1.3.6 and Chef installed as a gem. The apt installation will use the Opscode APT repository. The RubyGems installation requires installing gems with native extensions, so development related packages (ruby-dev, build-essential) are installed. These are not installed with the apt installation, as native extensions are already compiled in the required packages.
168
+
169
+ In addition to handling the software installation, these bootstrap templates do the following:
170
+
171
+ - Write the validation.pem per the local knife configuration.
172
+ - Write a default config file for Chef (`/etc/chef/client.rb`) using values from the `knife.rb`.
173
+ - Create a JSON attributes file containing the specified run list and run Chef.
174
+
175
+ In the case of the RubyGems, the `client.rb` will be written from scratch with a minimal set of values; see __EXAMPLES__. In the case of APT Package installation, `client.rb` will have the `validation_client_name` appended if it is not set to `chef-validator` (default config value), and the `node_name` will be added if `chef_node_name` option is specified.
176
+
177
+ When this is complete, the bootstrapped node will have:
178
+
179
+ - Latest Chef version installed from RubyGems or APT Packages from Opscode. This may be a later version than the local system.
180
+ - Be validated with the configured Chef Server.
181
+ - Have run Chef with its default run list if one is specfied.
182
+
183
+ Additional custom bootstrap templates can be created and stored in `.chef/bootstrap/DISTRO.erb`, replacing __DISTRO__ with the value passed with the `-d` or `--distro` option. See __EXAMPLES__ for more information.
184
+
185
+ ## CLIENT SUB-COMMANDS
186
+
187
+ Clients are entities that communicate with the Chef Server API.
188
+
189
+ __client bulk delete REGEX__ _(options)_
190
+
191
+ Delete clients on the Chef Server based on a regular expression. The regular expression (_REGEX_) should be in quotes, not in //'s.
192
+
193
+ __client create CLIENT__ _(options)_
194
+
195
+ * `-a`, `--admin `:
196
+ Create the client as an admin
197
+ * `-f`, `--file FILE`:
198
+ Write the key to a file
199
+
200
+ Create a new client. This generates an RSA keypair. The private key will be displayed on _STDOUT_ or written to the named file. The public half will be stored on the Server. For _chef-client_ systems, the private key should be copied to the system as `/etc/chef/client.pem`.
201
+
202
+ Admin clients should be created for users that will use _knife_ to access the API as an administrator. The private key will generally be copied to `~/.chef/CLIENT.pem` and referenced in the `knife.rb` configuration file.
203
+
204
+ __client delete CLIENT__ _(options)_
205
+
206
+ Deletes a registered client.
207
+
208
+ __client edit CLIENT__ _(options)_
209
+
210
+ Edit a registered client.
211
+
212
+ __client list__ _(options)_
213
+
214
+ * `-w`, `--with-uri`:
215
+ Show corresponding URIs
216
+
217
+ List all registered clients.
218
+
219
+ __client reregister CLIENT__ _(options)_
220
+
221
+ * `-f`, `--file FILE`:
222
+ Write the key to a file
223
+
224
+ Regenerate the RSA keypair for a client. The public half will be stored on the server and the private key displayed on _STDOUT_ or written to the named file.
225
+
226
+ __client show CLIENT__ _(options)_
227
+
228
+ * `-a`, `--attribute ATTR`:
229
+ Show only one attribute
230
+
231
+ Show a client.
232
+
233
+ ## COOKBOOK SUB-COMMANDS
234
+
235
+ Cookbooks are the fundamental unit of distribution in Chef. They encapsulate all recipes of resources and assets used to configure a particular aspect of the infrastructure. The following sub-commands can be used to manipulate the cookbooks stored on the Chef Server.
236
+
237
+ __cookbook bulk delete REGEX__ _(options)_
238
+
239
+ * `-p`, `--purge`:
240
+ Purge files from backing store. This will disable any cookbook that contains any of the same files as the cookbook being purged.
241
+
242
+ Delete cookbooks on the Chef Server based on a regular expression. The regular expression (_REGEX_) should be in quotes, not in //'s.
243
+
244
+ __cookbook create COOKBOOK__ _(options)_
245
+
246
+ * `-o`, `--cookbook-path PATH`:
247
+ The directory where the cookbook will be created
248
+ * `-r`, `--readme-format FORMAT`:
249
+ Format of the README file
250
+ * `-C`, `--copyright COPYRIGHT`:
251
+ Name of Copyright holder
252
+ * `-I`, `--license LICENSE`:
253
+ License for cookbook, apachev2 or none
254
+ * `-E`, `--email EMAIL`:
255
+ Email address of cookbook maintainer
256
+
257
+ This is a helper command that creates a new cookbook directory in the `cookbook_path`. The following directories and files are created for the named cookbook.
258
+
259
+ * COOKBOOK/attributes
260
+ * COOKBOOK/definitions
261
+ * COOKBOOK/files/default
262
+ * COOKBOOK/libraries
263
+ * COOKBOOK/metadata.rb
264
+ * COOKBOOK/providers
265
+ * COOKBOOK/README.rdoc
266
+ * COOKBOOK/recipes/default.rb
267
+ * COOKBOOK/resources
268
+ * COOKBOOK/templates/default
269
+
270
+ Supported README formats are 'rdoc' (default), 'md', 'mkd', 'txt'. The README file will be written with the specified extension and a set of helpful starting headers.
271
+
272
+ Specify `-C` or `--copyright` with the name of the copyright holder as your name or your company/organization name in a quoted string. If this value is not specified an all-caps string `YOUR_COMPANY_NAME` is used which can be easily changed with find/replace.
273
+
274
+ Specify `-I` or `--license` with the license that the cookbook is distributed under for sharing with other people or posting to the Opscode Cookbooks site. Be aware of the licenses of files you put inside the cookbook and follow any restrictions they describe. When using `none` (default) or `apachev2`, comment header text and metadata file are pre-filled. The `none` license will be treated as non-redistributable.
275
+
276
+ Specify `-E` or `--email` with the email address of the cookbook's maintainer. If this value is not specified, an all-caps string `YOUR_EMAIL` is used which can easily be changed with find/replace.
277
+
278
+ The cookbook copyright, license and email settings can be filled in the `knife.rb`, for example with default values:
279
+
280
+ cookbook_copyright "YOUR_COMPANY_NAME"
281
+ cookbook_license "none"
282
+ cookbook_email "YOUR_EMAIL"
283
+
284
+ __cookbook delete COOKBOOK [VERSION]__ _(options)_
285
+
286
+ * `-a`, `--all`:
287
+ Delete all versions
288
+ * `-p`, `--purge`:
289
+ Purge files from backing store. This will disable any cookbook that contains any of the same files as the cookbook being purged.
290
+
291
+ Delete the specified _VERSION_ of the named _COOKBOOK_. If no version is specified, and only one version exists on the server, that version will be deleted. If multiple versions are available on the server, you will be prompted for a version to delete.
292
+
293
+ __cookbook download COOKBOOK [VERSION]__ _(options)_
294
+
295
+ * `-d`, `--dir DOWNLOAD_DIRECTORY`:
296
+ The directory to download the cookbook into
297
+ * `-f`, `--force`:
298
+ Overwrite an existing directory with the download
299
+ * `-N`, `--latest`:
300
+ Download the latest version of the cookbook
301
+
302
+ Download a cookbook from the Chef Server. If no version is specified and only one version exists on the server, that version will be downloaded. If no version is specified and multiple versions are available on the server, you will be prompted for a version to download.
303
+
304
+ __cookbook list__ _(options)_
305
+
306
+ * `-w`, `--with-uri`:
307
+ Show corresponding URIs
308
+
309
+ List all the cookbooks.
310
+
311
+ __cookbook metadata COOKBOOK__ _(options)_
312
+
313
+ * `-a`, `--all`:
314
+ Generate metadata for all cookbooks, rather than just a single cookbook
315
+ * `-o`, `--cookbook-path PATH:PATH`:
316
+ A colon-separated path to look for cookbooks in
317
+
318
+ Generate cookbook metadata for the named _COOKBOOK_. The _PATH_ used here specifies where the cookbooks directory is located and corresponds to the `cookbook_path` configuration option.
319
+
320
+ __cookbook metadata from FILE__ _(options)_
321
+
322
+ Load the cookbook metadata from a specified file.
323
+
324
+ __cookbook show COOKBOOK [VERSION] [PART] [FILENAME]__ _(options)_
325
+
326
+ * `-f`, `--fqdn FQDN `:
327
+ The FQDN of the host to see the file for
328
+ * `-p`, `--platform PLATFORM `:
329
+ The platform to see the file for
330
+ * `-V`, `--platform-version VERSION`:
331
+ The platform version to see the file for
332
+
333
+ Show a particular part of a _COOKBOOK_ for the specified _VERSION_. _PART_ can be one of:
334
+
335
+ * _attributes_
336
+ * _definitions_
337
+ * _files_
338
+ * _libraries_
339
+ * _providers_
340
+ * _recipes_
341
+ * _resources_
342
+ * _templates_
343
+
344
+ __cookbook test [COOKBOOKS...]__ _(options)_
345
+
346
+ * `-a`, `--all`:
347
+ Test all cookbooks, rather than just a single cookbook
348
+ * `-o`, `--cookbook-path PATH:PATH`:
349
+ A colon-separated path to look for cookbooks in
350
+
351
+ Test the specified cookbooks for syntax errors. This uses the built-in Ruby syntax checking option for files in the cookbook ending in `.rb`, and the ERB syntax check for files ending in `.erb` (templates).
352
+
353
+ __cookbook upload [COOKBOOKS...]__ _(options)_
354
+
355
+ * `-a`, `--all`:
356
+ Upload all cookbooks, rather than just a single cookbook
357
+ * `-o`, `--cookbook-path PATH:PATH`:
358
+ A colon-separated path to look for cookbooks in
359
+
360
+ Uploads the specified cookbooks to the Chef Server. The actual upload executes a number of commands, most of which occur on the local machine. The cookbook is staged in a temporary location. Then the `cookbook_path` (or `-o PATH`) is processed to search for the named cookbook, and each occurance is copied in the order specified. A syntax check is performed a la `cookbook test`, above. The metadata is generated, a la `cookbook metadata`. A gzip(1)'ed, tar(1) file is created, and is uploaded to the server.
361
+
362
+ ## COOKBOOK SITE SUB-COMMANDS
363
+
364
+ The following sub-commands are still in the context of cookbooks, but they make use of Opscode's Cookbook Community site, _http://cookbooks.opscode.com/_. That site has an API, and these sub-commands utilize that API, rather than the Chef Server API.
365
+
366
+ __cookbook site download COOKBOOK [VERSION]__ _(options)_
367
+
368
+ * `-f`, `--file FILE`:
369
+ The filename to write to
370
+
371
+ Downloads a specific cookbook from the Community site, optionally specifying a certain version.
372
+
373
+ __cookbook site list__ _(options)_
374
+
375
+ * `-w`, `--with-uri`:
376
+ Show corresponding URIs
377
+
378
+ Lists available cookbooks from the Community site.
379
+
380
+ __cookbook site search QUERY__ _(options)_
381
+
382
+ Searches the Community site with the specified query.
383
+
384
+ __cookbook site share COOKBOOK CATEGORY__ _(options)_
385
+
386
+ * `-k`, `--key KEY`:
387
+ API Client Key
388
+ * `-u`, `--user USER`:
389
+ API Client Username
390
+ * `-o`, `--cookbook-path PATH:PATH`:
391
+ A colon-separated path to look for cookbooks in
392
+
393
+ Uploads the specified cookbook using the given category to the Opscode cookbooks site. Requires a login user and certificate for the Opscode Cookbooks site. See __EXAMPLES__ for usage if the Opscode user and certificate pair are not used for authenticating with the Chef Server. In other words, if the Chef Server is not the Opscode Platform.
394
+
395
+ __cookbook site unshare COOKBOOK__
396
+
397
+ Stops sharing the specified cookbook on the Opscode cookbooks site.
398
+
399
+ __cookbook site show COOKBOOK [VERSION]__ _(options)_
400
+
401
+ Shows information from the site about a particular cookbook.
402
+
403
+ __cookbook site vendor COOKBOOK [VERSION]__ _(options)_
404
+
405
+ * `-d`, `--dependencies`:
406
+ Grab dependencies automatically
407
+
408
+ Uses `git` version control in conjunction with the cookbook site to download upstream cookbooks. A new vendor branch is created in git, the cookbook downloaded from the site and untarred, then the master branch is merged. This allows the user to track upstream changes to cookbooks while merging in customizations. If _-d_ is specified, all the cookbooks it depends on (via metadata _dependencies_) are downloaded and untarred as well, each using their own vendor branch.
409
+
410
+ ## DATA BAG SUB-COMMANDS
411
+
412
+ Data bags are stores of JSON blobs. These blobs are called items. They are free form JSON and indexed by the Chef Server.
413
+
414
+ __data bag create BAG [ITEM]__ _(options)_
415
+
416
+ Create a new data bag, or an item in a data bag.
417
+
418
+ __data bag delete BAG [ITEM]__ _(options)_
419
+
420
+ Delete a data bag, or an item from a data bag.
421
+
422
+ __data bag edit BAG ITEM__ _(options)_
423
+
424
+ Edit an item in a data bag.
425
+
426
+ __data bag from file BAG FILE__ _(options)_
427
+
428
+ Load a data bag item from a JSON file. Looks in the directory `data_bags/BAG/ITEM.json` unless a relative path is specified.
429
+
430
+ __data bag list__ _(options)_
431
+
432
+ * `-w`, `--with-uri`:
433
+ Show corresponding URIs
434
+
435
+ List the available data bags.
436
+
437
+ __data bag show BAG [ITEM]__ _(options)_
438
+
439
+ Show a specific data bag or an item in a data bag.
440
+
441
+ ## NODE SUB-COMMANDS
442
+
443
+ Nodes are the entities which are configured with Chef. Typically these are servers or workstations. Nodes are registered as a client, by default by the fully qualified domain name (fqdn). A single client may configure more than one node.
444
+
445
+ __node bulk delete REGEX__ _(options)_
446
+
447
+ Delete nodes on the Chef Server based on a regular expression. The regular expression (_REGEX_) should be in quotes, not in //'s.
448
+
449
+ __node create NODE__ _(options)_
450
+
451
+ Create a new node.
452
+
453
+ __node delete NODE__ _(options)_
454
+
455
+ Delete a single node.
456
+
457
+ __node edit NODE__ _(options)_
458
+
459
+ Edit a node.
460
+
461
+ __node from file FILE__ _(options)_
462
+
463
+ Create a node from a JSON file.
464
+
465
+ __node list__ _(options)_
466
+
467
+ * `-w`, `--with-uri`:
468
+ Show corresponding URIs
469
+
470
+ List all nodes.
471
+
472
+ `node run_list add [NODE] [ENTRY]` _(options)_
473
+
474
+ * `-a`, `--after ITEM`:
475
+ Place the ENTRY in the run list after ITEM
476
+
477
+ Add a recipe or role to the node's `run_list`.
478
+
479
+ `node run_list remove [NODE] [ENTRY]` _(options)_
480
+
481
+ Remove a recipe or role from the node's `run_list`.
482
+
483
+ __node show NODE__ _(options)_
484
+
485
+ * `-a`, `--attribute [ATTR]`:
486
+ Show only one attribute
487
+ * `-r`, `--run-list `:
488
+ Show only the run list
489
+
490
+ Show a node.
491
+
492
+ ## RECIPE SUB-COMMANDS
493
+
494
+ __recipe list [PATTERN]__
495
+
496
+ List the recipes available on the server. The results shown can be limited with the optional PATTERN, which is a regular expression. PATTERN should be given in quotes, without slashes.
497
+
498
+ ## ROLE SUB-COMMANDS
499
+
500
+ __role bulk delete REGEX__ _(options)_
501
+
502
+ Delete roles on the Chef Server based on a regular expression. The regular expression (_REGEX_) should be in quotes, not in //'s.
503
+
504
+ __role create ROLE__ _(options)_
505
+
506
+ * `-d`, `--description`:
507
+ The role description
508
+
509
+ Create a new role.
510
+
511
+ __role delete ROLE__ _(options)_
512
+
513
+ Delete a role.
514
+
515
+ __role edit ROLE__ _(options)_
516
+
517
+ Edit a role.
518
+
519
+ __role from file FILE__ _(options)_
520
+
521
+ Create or update a role from a role Ruby DSL (`.rb`) or JSON file.
522
+
523
+ __role list__ _(options)_
524
+
525
+ * `-w`, `--with-uri`:
526
+ Show corresponding URIs
527
+
528
+ List roles.
529
+
530
+ __role show ROLE__ _(options)_
531
+
532
+ * `-a`, `--attribute ATTR`:
533
+ Show only one attribute
534
+
535
+ Show a specific role.
536
+
537
+ ## CLOUD COMPUTING SUB-COMMANDS
538
+
539
+ The next sections describe sub-commands to work with various Cloud Computing APIs to launch server instances with validation and run-time configuration that Chef knows about. These sub-commands require the fog Ruby library. On Debian and Ubuntu systems with Opscode's apt repository (apt.opscode.com), this is the package `libfog-ruby`. It is also available as a RubyGem, `fog`.
540
+
541
+ The Blue Box, Rackspace and Terremark server creation sub-commands are at an early stage of development. They do not yet use the `bootstrap` sub-command to install Chef, and make a few assumptions to be aware. Right now when creating instances of these types, knife will assume an Ubuntu image, install Ruby from packages, RubyGems from source and Chef as a RubyGem. As these commands are developed further, they will utilize the `bootstrap` sub-command.
542
+
543
+ In order to use knife with the various __CLOUD COMPUTING SUB-COMMANDS__, credentials need to be added to the configuration file. See __CONFIGURATION__.
544
+
545
+ ## BLUE BOX SUB-COMMANDS
546
+
547
+ __bluebox server create [RUN LIST...]__ _(options)_
548
+
549
+ * `-f`, `--flavor FLAVOR`:
550
+ This is the product type (Block size) you're requesting to deploy. Requires the UUID of the image.
551
+
552
+ * `-i`, `--image IMAGE`:
553
+ The image (or OS distribution) to deploy. This can be a pre-built Blue Box template, or this can be a template you've archived previously. Requires the UUID of the image.
554
+
555
+ * `-U`, `--username USERNAME`:
556
+ Username created on the deployed server. Defaults to "deploy".
557
+
558
+ * `-P`, `--password PASSWORD`:
559
+ Password installed for the created user on the deployed server. Can be bypassed by defining a SSH key in your knife configuration ( Chef::Config[:knife][:ssh_key] ).
560
+
561
+ * `--bootstrap true/false`:
562
+ Allows you to enable or disable the bootstrap process.
563
+
564
+ Creates a new Blue Box Group Blocks instance and bootstraps it by checking out a github repo and installs a bare minimum installation of chef on the instance; it then executes the specified run list.
565
+
566
+ __bluebox server delete BLOCK-HOSTNAME__
567
+
568
+ Deletes a running Blue Box Group Blocks server.
569
+
570
+ __bluebox server list__
571
+
572
+ Lists running Blue Box Group Blocks servers.
573
+
574
+ __bluebox images list__
575
+
576
+ Lists the available Blue Box Group Blocks server images to boot.
577
+
578
+ ## EC2 SUB-COMMANDS
579
+
580
+ Chef is commonly used with Amazon AWS EC2 nodes. This sub-command will generate instance metadata that can be used to automatically configure an EC2 instance with Chef. This requires an AMI that has Chef preinstalled with a configuration file that can parse the metadata at run-time. At this time this is the only sub-command for EC2, but more may be added later similar to __RACKSPACE__ and __TERREMARK__ below.
581
+
582
+ __ec2 instance data [RUN LIST...]__ _(options)_
583
+
584
+ * `-e`, `--edit`:
585
+ Edit the instance data
586
+
587
+ The _RUN LIST_ should be specified as a space separated list of roles or recipes that will be used by the instance to configure the server.
588
+
589
+ __ec2 server create [RUN LIST...]__ _(options)_
590
+
591
+ * `-Z`, `--availability-zone ZONE`:
592
+ The Availability Zone
593
+ * `--region`:
594
+ Your AWS region
595
+ * `-A`, `--aws-access-key-id KEY `:
596
+ Your AWS Access Key ID
597
+ * `-K SECRET`, `--aws-secret-access-key`:
598
+ Your AWS API Secret Access Key
599
+ * `-f`, `--flavor FLAVOR`:
600
+ The flavor of server (m1.small, m1.medium, etc)
601
+ * `-i`, `--image IMAGE`:
602
+ The AMI for the server
603
+ * `-G`, `--groups X,Y,Z `:
604
+ The security groups for this server
605
+ * `-S`, `--ssh-key KEY `:
606
+ The SSH root key, corresponds to an Amazon Keypair.
607
+ * `-I`, `--identity-file IDENTITY_FILE`:
608
+ The SSH identity file used for authentication, passed to `bootstrap`.
609
+ * `-P`, `--ssh-password PASSWORD`:
610
+ The ssh password, passed to `bootstrap`.
611
+ * `-x`, `--ssh-user USERNAME`:
612
+ The ssh username, passed to `bootstrap`.
613
+ * `--prerelease`:
614
+ Install pre-release Chef gems, passed to `bootstrap`.
615
+ * `--template-file TEMPLATE`:
616
+ Full path to location of template to use, passed to `bootstrap`.
617
+ * `-d`, `--distro DISTRO`:
618
+ Bootstrap a distro using a template, passed to `bootstrap`.
619
+
620
+ Creates a new Amazon AWS EC2 instance and bootstraps it by calling the `bootstrap` sub-command. The `[RUN LIST...]` items are passed to the bootstrap's `run_list` config parameter/option. See the __BOOTSTRAP SUB-COMMANDS__ section above for more information.
621
+
622
+ __ec2 server delete SERVER [SERVER]__ _(options)_
623
+
624
+ * `-A`, `--aws-access-key-id KEY`:
625
+ Your AWS Access Key ID
626
+ * `-K SECRET`, `--aws-secret-access-key`:
627
+ Your AWS API Secret Access Key
628
+
629
+ Terminates a running Amazon AWS EC2 instance.
630
+
631
+ __ec2 server list [RUN LIST...]__ _(options)_
632
+
633
+ * `-A`, `--aws-access-key-id KEY`:
634
+ Your AWS Access Key ID
635
+ * `-K SECRET`, `--aws-secret-access-key`:
636
+ Your AWS API Secret Access Key
637
+
638
+ List running Amazon AWS EC2 instances.
639
+
640
+ ## RACKSPACE SUB-COMMANDS
641
+
642
+ In addition to EC2 nodes, Chef can be used on Rackspace Cloud nodes. The following sub-commands allow manipulating Rackspace Cloud nodes via the `fog` library.
643
+
644
+ __rackspace server create [RUN LIST...]__ _(options)_
645
+
646
+ * `-K`, `--rackspace-api-key KEY`:
647
+ Your rackspace API key
648
+ * `-A USERNAME`, `--rackspace-api-username`:
649
+ Your rackspace API username
650
+ * `-f`, `--flavor FLAVOR `:
651
+ The flavor of server
652
+ * `-i`, `--image IMAGE `:
653
+ The image of the server
654
+ * `-N`, `--server-name NAME`:
655
+ The server name
656
+
657
+ Creates a new Rackspace Cloud server.
658
+
659
+ __rackspace server delete SERVER__ _(options)_
660
+
661
+ Deletes a running Rackspace Cloud server.
662
+
663
+ __rackspace server list__ _(options)_
664
+
665
+ Lists running Rackspace Cloud servers.
666
+
667
+ ## SLICEHOST SUB-COMMANDS
668
+
669
+ As above, Chef can also be used on Slicehost nodes. The following sub-commands allow manipulating Slicehost nodes via the `fog` library.
670
+
671
+ __slicehost server create [RUN LIST...]__ _(options)_
672
+ * `-f`, `--flavor FLAVOR`:
673
+ The flavor of server
674
+ * `-i`, `--image IMAGE`:
675
+ The image of the server
676
+ * `-N`, `--server-name NAME`:
677
+ The server name
678
+ * `-K`, `--slicehost-password PASSWORD`:
679
+ Your slicehost API password
680
+
681
+ Creates a new slicehost server.
682
+
683
+ __slicehost server list__ _(options)_
684
+
685
+ Lists running Slicehost servers.
686
+
687
+ __slicehost server delete SLICENAME__
688
+
689
+ Deletes a running Slicehost server.
690
+
691
+ __slicehost images list__
692
+
693
+ Lists the available Slicehost server images to boot.
694
+
695
+ ## TERREMARK SUB-COMMANDS
696
+
697
+ As above, Chef can also be used on Terremark vCloud nodes. The following sub-commands allow manipulating Terremark vCloud nodes via the `fog` library.
698
+
699
+ __terremark server create NAME [RUN LIST...]__ _(options)_
700
+
701
+ * `-K PASSWORD`, `--terremark-password`:
702
+ Your terremark password
703
+ * `-S`, `--terremark-service SERVICE`:
704
+ Your terremark service name
705
+ * `-A USERNAME`, `--terremark-username`:
706
+ Your terremark username
707
+
708
+ Creates a new Terremark vCloud server.
709
+
710
+ __terremark server delete SERVER__ _(options)_
711
+
712
+ Deletes a running Terremark vCloud server.
713
+
714
+ __terremark server list__ _(options)_
715
+
716
+ * `-K PASSWORD`, `--terremark-password`:
717
+ Your terremark password
718
+ * `-S`, `--terremark-service SERVICE`:
719
+ Your terremark service name
720
+ * `-A USERNAME`, `--terremark-username`:
721
+ Your terremark username
722
+
723
+ Lists running Terremark vCloud servers.
724
+
725
+ ## CONFIGURATION
726
+
727
+ The knife configuration file is a Ruby DSL to set configuration parameters for Knife's __GENERAL OPTIONS__. The default location for the config file is `~/.chef/knife.rb`. If managing multiple Chef repositories, per-repository config files can be created. The file must be `.chef/knife.rb` in the current directory of the repository.
728
+
729
+ If the config file exists, knife uses these settings for __GENERAL OPTIONS__ defaults.
730
+
731
+ `log_level`
732
+
733
+ A Ruby symbol specifying the log level. Corresponds to `-l` or `--log_level` option. Default is _:info_. Valid values are:
734
+
735
+ * :info
736
+ * :debug
737
+ * :warn
738
+ * :fatal
739
+
740
+ `log_location`
741
+
742
+ Corresponds to the `-L` or `--log-file` option. Defaults is __STDOUT__. Valid values are __STDOUT__ or a filename.
743
+
744
+ `node_name`
745
+
746
+ User to authenticate to the Chef server. Corresponds to the `-u` or `--user` option. This is requested from the user when running this sub-command.
747
+
748
+ `client_key`
749
+
750
+ Private key file to authenticate to the Chef server. Corresponds to the `-k` or `--key` option. This is requested from the user when running this sub-command.
751
+
752
+ `chef_server_url`
753
+
754
+ URL of the Chef server. Corresponds to the `-s` or `--server-url` option. This is requested from the user when running this sub-command.
755
+
756
+ `cache_type`
757
+
758
+ The type of cache to use. Default is BasicFile. This can be any type of Cache that moneta supports: BasicFile, Berkeley, Couch, DataMapper, File, LMC, Memcache, Memory, MongoDB, Redis, Rufus, S3, SDBM, Tyrant, Xattr, YAML.
759
+
760
+ `cache_options`
761
+
762
+ Specifies various options to use for caching. Default reads the Chef client configuration (/etc/chef/checksums).
763
+
764
+ `validation_client_name`
765
+
766
+ Specifies the name of the client used to validate new clients. This is requested from the user when running the configuration sub-command.
767
+
768
+ `validation_key`
769
+
770
+ Specifies the private key file to use for generating ec2 instance data for validating new clients. This is implied from the `validation_client_name`.
771
+
772
+ `cookbook_copyright`
773
+ `cookbook_email`
774
+ `cookbook_license`
775
+
776
+ Used by `knife cookbook create` sub-command to specify the copyright holder, maintainer email and license (respectively) for new cookbooks. The copyright holder is listed as the maintainer in the cookbook's metadata and as the Copyright in the comments of the default recipe. The maintainer email is used in the cookbook metadata. The license determines what preamble to put in the comment of the default recipe, and is listed as the license in the cookbook metadata. Currently supported licenses are "apachev2" and "none". Any other values will result in an empty license in the metadata (needs to be filled in by the author), and no comment preamble in the default recipe.
777
+
778
+ `knife[:aws_access_key_id]`
779
+ `knife[:aws_secret_access_key]`
780
+
781
+ Specifies the Amazon AWS EC2 credentials to use when running the ec2 sub-commands.
782
+
783
+ `knife[:rackspace_api_username]`
784
+ `knife[:rackspace_api_key]`
785
+
786
+ Specifies the Rackspace Cloud credentials to use when running the rackspace sub-commands.
787
+
788
+ `knife[:terremark_username]`
789
+ `knife[:terremark_password]`
790
+ `knife[:terremark_service]`
791
+
792
+ Specifies the Terremark vCloud credentials to use when running the terremark sub-commands.
793
+
794
+ `knife[:slicehost_password]`
795
+
796
+ Specifies the Slicehost password to use when running the slicdehost sub-commands.
797
+
798
+ ## FILES
799
+
800
+ _~/.chef/knife.rb_
801
+
802
+ Ruby DSL configuration file for knife. See __CONFIGURATION__.
803
+
804
+ ## CHEF WORKFLOW
805
+
806
+ When working with Chef and Knife in the local repository, the recommended workflow outline looks like:
807
+
808
+ * Create repository. A skeleton sample is provided at _http://github.com/opscode/chef-repo/_.
809
+ * Configure knife, see __CONFIGURATION__.
810
+ * Download cookbooks from the Opscode cookbooks site, see __COOKBOOK SITE SUB-COMMANDS__.
811
+ * Or, create new cookbooks, see `cookbook create` sub-command.
812
+ * Commit changes to the version control system. See your tool's documentation.
813
+ * Upload cookbooks to the Chef Server, see __COOKBOOK SUB-COMMANDS__.
814
+ * Launch instances in the Cloud, OR provision new hosts; see __CLOUD COMPUTING SUB-COMMANDS__ and __BOOTSTRAP SUB-COMMANDS__.
815
+ * Watch Chef configure systems!
816
+
817
+ A note about git: Opscode and many folks in the Chef community use git, but it is not required, except in the case of the `cookbook site vendor` sub-command, as it uses git directly. Version control is strongly recommended though, and git fits with a lot of the workflow paradigms.
818
+
819
+ ## EXAMPLES
820
+
821
+ Example client config (`/etc/chef/client.rb`) from `knife configure client`. The same configuration is used when using the `knife bootstrap` command with the default `gem` templates that come with Chef.
822
+
823
+ log_level :info
824
+ log_location STDOUT
825
+ chef_server_url 'https://api.opscode.com/organizations/ORGNAME'
826
+ validation_client_name 'ORGNAME-validator'
827
+
828
+ Setting up a custom bootstrap is fairly straightforward. Create `.chef/bootstrap` in your Chef Repository directory or in `$HOME/.chef/bootstrap`. Then create the ERB template file.
829
+
830
+ mkdir ~/.chef/bootstrap
831
+ vi ~/.chef/bootstrap/debian5.0-apt.erb
832
+
833
+ For example, to create a new bootstrap template that should be used when setting up a new Debian node. Edit the template to run the commands, set up the validation certificate and the client configuration file, and finally to run chef-client on completion. The bootstrap template can be called with:
834
+
835
+ knife bootstrap mynode.example.com --template-file ~/.chef/bootstrap/debian5.0-apt.erb
836
+
837
+ Or,
838
+
839
+ knife bootstrap mynode.example.com --distro debian5.0-apt
840
+
841
+ The `--distro` parameter will automatically look in the `~/.chef/bootstrap` directory for a file named `debian5.0-apt.erb`.
842
+
843
+ Templates provided by the Chef installation are located in `BASEDIR/lib/chef/knife/bootstrap/*.erb`, where _BASEDIR_ is the location where the package or Gem installed the Chef client libraries.
844
+
845
+ Uploading cookbooks to the Opscode cookbooks site using the user/certificate specifically:
846
+
847
+ knife cookbook site share example Other -k ~/.chef/USERNAME.pem -u USERNAME
848
+
849
+ ## SEE ALSO
850
+
851
+ Full documentation for Chef is located on the Chef wiki, http://wiki.opscode.com/display/chef/Home/.
852
+
853
+ JSON is JavaScript Object Notation and more information can be found at http://json.org/.
854
+
855
+ SOLR is an open source search engine. The Chef Server includes a SOLR installation. More information about SOLR, including the search query syntax, can be found at http://lucene.apache.org/solr/.
856
+
857
+ Git is a version control system and documented at http://git-scm.com/.
858
+
859
+ This manual page was generated in nroff from Markdown with ronn. Ryan Tomayko wrote ronn and more information can be found at http://rtomayko.github.com/ronn/ronn.5.html.
860
+
861
+ ## AUTHOR
862
+
863
+ Chef was written by Adam Jacob <adam@opscode.com> of Opscode (http://www.opscode.com), with contributions from the community. This manual page was written by Joshua Timberman <joshua@opscode.com>. Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.
864
+
865
+ On Debian systems, the complete text of the Apache 2.0 License can be found in `/usr/share/common-licenses/Apache-2.0`.