mbailey-chef 0.9.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (345) hide show
  1. data/LICENSE +201 -0
  2. data/README.rdoc +172 -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/common/man/man1/chef-indexer.1 +42 -0
  9. data/distro/common/man/man1/chef-server-webui.1 +106 -0
  10. data/distro/common/man/man1/chef-server.1 +107 -0
  11. data/distro/common/man/man1/chef-solr-indexer.1 +55 -0
  12. data/distro/common/man/man1/chef-solr.1 +55 -0
  13. data/distro/common/man/man8/chef-client.8 +63 -0
  14. data/distro/common/man/man8/chef-solo.8 +57 -0
  15. data/distro/common/man/man8/chef-solr-rebuild.8 +37 -0
  16. data/distro/common/man/man8/knife.8 +1349 -0
  17. data/distro/common/man/man8/shef.8 +45 -0
  18. data/distro/common/markdown/README +3 -0
  19. data/distro/common/markdown/knife.mkd +832 -0
  20. data/distro/debian/etc/default/chef-client +4 -0
  21. data/distro/debian/etc/default/chef-server +9 -0
  22. data/distro/debian/etc/default/chef-server-webui +9 -0
  23. data/distro/debian/etc/default/chef-solr +7 -0
  24. data/distro/debian/etc/default/chef-solr-indexer +7 -0
  25. data/distro/debian/etc/init/chef-client.conf +17 -0
  26. data/distro/debian/etc/init/chef-server-webui.conf +17 -0
  27. data/distro/debian/etc/init/chef-server.conf +17 -0
  28. data/distro/debian/etc/init/chef-solr-indexer.conf +17 -0
  29. data/distro/debian/etc/init/chef-solr.conf +17 -0
  30. data/distro/debian/etc/init.d/chef-client +175 -0
  31. data/distro/debian/etc/init.d/chef-server +122 -0
  32. data/distro/debian/etc/init.d/chef-server-webui +123 -0
  33. data/distro/debian/etc/init.d/chef-solr +177 -0
  34. data/distro/debian/etc/init.d/chef-solr-indexer +176 -0
  35. data/distro/redhat/etc/init.d/chef-client +106 -0
  36. data/distro/redhat/etc/init.d/chef-server +112 -0
  37. data/distro/redhat/etc/init.d/chef-server-webui +112 -0
  38. data/distro/redhat/etc/init.d/chef-solr +104 -0
  39. data/distro/redhat/etc/init.d/chef-solr-indexer +104 -0
  40. data/distro/redhat/etc/logrotate.d/chef-client +8 -0
  41. data/distro/redhat/etc/logrotate.d/chef-server +8 -0
  42. data/distro/redhat/etc/logrotate.d/chef-server-webui +8 -0
  43. data/distro/redhat/etc/logrotate.d/chef-solr +8 -0
  44. data/distro/redhat/etc/logrotate.d/chef-solr-indexer +8 -0
  45. data/distro/redhat/etc/sysconfig/chef-client +15 -0
  46. data/distro/redhat/etc/sysconfig/chef-server +14 -0
  47. data/distro/redhat/etc/sysconfig/chef-server-webui +14 -0
  48. data/distro/redhat/etc/sysconfig/chef-solr +8 -0
  49. data/distro/redhat/etc/sysconfig/chef-solr-indexer +7 -0
  50. data/lib/chef/api_client.rb +264 -0
  51. data/lib/chef/application/agent.rb +18 -0
  52. data/lib/chef/application/client.rb +246 -0
  53. data/lib/chef/application/knife.rb +171 -0
  54. data/lib/chef/application/solo.rb +215 -0
  55. data/lib/chef/application.rb +127 -0
  56. data/lib/chef/applications.rb +4 -0
  57. data/lib/chef/certificate.rb +194 -0
  58. data/lib/chef/checksum.rb +182 -0
  59. data/lib/chef/checksum_cache.rb +173 -0
  60. data/lib/chef/client.rb +304 -0
  61. data/lib/chef/config.rb +240 -0
  62. data/lib/chef/cookbook/cookbook_collection.rb +44 -0
  63. data/lib/chef/cookbook/file_system_file_vendor.rb +54 -0
  64. data/lib/chef/cookbook/file_vendor.rb +48 -0
  65. data/lib/chef/cookbook/metadata/version.rb +87 -0
  66. data/lib/chef/cookbook/metadata.rb +500 -0
  67. data/lib/chef/cookbook/remote_file_vendor.rb +87 -0
  68. data/lib/chef/cookbook/syntax_check.rb +136 -0
  69. data/lib/chef/cookbook_loader.rb +227 -0
  70. data/lib/chef/cookbook_site_streaming_uploader.rb +244 -0
  71. data/lib/chef/cookbook_uploader.rb +103 -0
  72. data/lib/chef/cookbook_version.rb +930 -0
  73. data/lib/chef/couchdb.rb +239 -0
  74. data/lib/chef/daemon.rb +172 -0
  75. data/lib/chef/data_bag.rb +215 -0
  76. data/lib/chef/data_bag_item.rb +228 -0
  77. data/lib/chef/exceptions.rb +66 -0
  78. data/lib/chef/file_access_control.rb +140 -0
  79. data/lib/chef/file_cache.rb +218 -0
  80. data/lib/chef/handler/json_file.rb +58 -0
  81. data/lib/chef/handler.rb +206 -0
  82. data/lib/chef/index_queue/amqp_client.rb +113 -0
  83. data/lib/chef/index_queue/consumer.rb +76 -0
  84. data/lib/chef/index_queue/indexable.rb +76 -0
  85. data/lib/chef/index_queue.rb +29 -0
  86. data/lib/chef/knife/bootstrap/archlinux-gems.erb +44 -0
  87. data/lib/chef/knife/bootstrap/centos5-gems.erb +41 -0
  88. data/lib/chef/knife/bootstrap/client-install.vbs +80 -0
  89. data/lib/chef/knife/bootstrap/fedora13-gems.erb +38 -0
  90. data/lib/chef/knife/bootstrap/ubuntu10.04-apt.erb +32 -0
  91. data/lib/chef/knife/bootstrap/ubuntu10.04-gems.erb +43 -0
  92. data/lib/chef/knife/bootstrap/windows-gems.erb +34 -0
  93. data/lib/chef/knife/bootstrap.rb +181 -0
  94. data/lib/chef/knife/client_bulk_delete.rb +40 -0
  95. data/lib/chef/knife/client_create.rb +70 -0
  96. data/lib/chef/knife/client_delete.rb +45 -0
  97. data/lib/chef/knife/client_edit.rb +45 -0
  98. data/lib/chef/knife/client_list.rb +40 -0
  99. data/lib/chef/knife/client_reregister.rb +56 -0
  100. data/lib/chef/knife/client_show.rb +50 -0
  101. data/lib/chef/knife/configure.rb +140 -0
  102. data/lib/chef/knife/configure_client.rb +52 -0
  103. data/lib/chef/knife/cookbook_bulk_delete.rb +58 -0
  104. data/lib/chef/knife/cookbook_create.rb +209 -0
  105. data/lib/chef/knife/cookbook_delete.rb +143 -0
  106. data/lib/chef/knife/cookbook_download.rb +130 -0
  107. data/lib/chef/knife/cookbook_list.rb +41 -0
  108. data/lib/chef/knife/cookbook_metadata.rb +82 -0
  109. data/lib/chef/knife/cookbook_metadata_from_file.rb +40 -0
  110. data/lib/chef/knife/cookbook_show.rb +98 -0
  111. data/lib/chef/knife/cookbook_site_download.rb +58 -0
  112. data/lib/chef/knife/cookbook_site_list.rb +56 -0
  113. data/lib/chef/knife/cookbook_site_search.rb +51 -0
  114. data/lib/chef/knife/cookbook_site_share.rb +109 -0
  115. data/lib/chef/knife/cookbook_site_show.rb +57 -0
  116. data/lib/chef/knife/cookbook_site_unshare.rb +52 -0
  117. data/lib/chef/knife/cookbook_site_vendor.rb +133 -0
  118. data/lib/chef/knife/cookbook_test.rb +82 -0
  119. data/lib/chef/knife/cookbook_upload.rb +95 -0
  120. data/lib/chef/knife/data_bag_create.rb +59 -0
  121. data/lib/chef/knife/data_bag_delete.rb +48 -0
  122. data/lib/chef/knife/data_bag_edit.rb +50 -0
  123. data/lib/chef/knife/data_bag_from_file.rb +44 -0
  124. data/lib/chef/knife/data_bag_list.rb +43 -0
  125. data/lib/chef/knife/data_bag_show.rb +41 -0
  126. data/lib/chef/knife/ec2_instance_data.rb +46 -0
  127. data/lib/chef/knife/ec2_server_create.rb +216 -0
  128. data/lib/chef/knife/ec2_server_delete.rb +90 -0
  129. data/lib/chef/knife/ec2_server_list.rb +88 -0
  130. data/lib/chef/knife/exec.rb +52 -0
  131. data/lib/chef/knife/index_rebuild.rb +51 -0
  132. data/lib/chef/knife/node_bulk_delete.rb +43 -0
  133. data/lib/chef/knife/node_create.rb +47 -0
  134. data/lib/chef/knife/node_delete.rb +44 -0
  135. data/lib/chef/knife/node_edit.rb +44 -0
  136. data/lib/chef/knife/node_from_file.rb +42 -0
  137. data/lib/chef/knife/node_list.rb +41 -0
  138. data/lib/chef/knife/node_run_list_add.rb +64 -0
  139. data/lib/chef/knife/node_run_list_remove.rb +45 -0
  140. data/lib/chef/knife/node_show.rb +54 -0
  141. data/lib/chef/knife/rackspace_server_create.rb +156 -0
  142. data/lib/chef/knife/rackspace_server_delete.rb +57 -0
  143. data/lib/chef/knife/rackspace_server_list.rb +59 -0
  144. data/lib/chef/knife/recipe_list.rb +32 -0
  145. data/lib/chef/knife/role_bulk_delete.rb +44 -0
  146. data/lib/chef/knife/role_create.rb +52 -0
  147. data/lib/chef/knife/role_delete.rb +44 -0
  148. data/lib/chef/knife/role_edit.rb +45 -0
  149. data/lib/chef/knife/role_from_file.rb +46 -0
  150. data/lib/chef/knife/role_list.rb +40 -0
  151. data/lib/chef/knife/role_show.rb +51 -0
  152. data/lib/chef/knife/search.rb +94 -0
  153. data/lib/chef/knife/slicehost_images_list.rb +53 -0
  154. data/lib/chef/knife/slicehost_server_create.rb +103 -0
  155. data/lib/chef/knife/slicehost_server_delete.rb +61 -0
  156. data/lib/chef/knife/slicehost_server_list.rb +64 -0
  157. data/lib/chef/knife/ssh.rb +328 -0
  158. data/lib/chef/knife/status.rb +87 -0
  159. data/lib/chef/knife/terremark_server_create.rb +152 -0
  160. data/lib/chef/knife/terremark_server_delete.rb +87 -0
  161. data/lib/chef/knife/terremark_server_list.rb +77 -0
  162. data/lib/chef/knife/windows_bootstrap.rb +154 -0
  163. data/lib/chef/knife.rb +522 -0
  164. data/lib/chef/log.rb +61 -0
  165. data/lib/chef/mixin/check_helper.rb +31 -0
  166. data/lib/chef/mixin/checksum.rb +32 -0
  167. data/lib/chef/mixin/command/unix.rb +215 -0
  168. data/lib/chef/mixin/command/windows.rb +72 -0
  169. data/lib/chef/mixin/command.rb +220 -0
  170. data/lib/chef/mixin/convert_to_class_name.rb +63 -0
  171. data/lib/chef/mixin/create_path.rb +56 -0
  172. data/lib/chef/mixin/deep_merge.rb +225 -0
  173. data/lib/chef/mixin/deprecation.rb +65 -0
  174. data/lib/chef/mixin/find_preferred_file.rb +92 -0
  175. data/lib/chef/mixin/from_file.rb +50 -0
  176. data/lib/chef/mixin/language.rb +156 -0
  177. data/lib/chef/mixin/language_include_attribute.rb +61 -0
  178. data/lib/chef/mixin/language_include_recipe.rb +52 -0
  179. data/lib/chef/mixin/params_validate.rb +225 -0
  180. data/lib/chef/mixin/recipe_definition_dsl_core.rb +81 -0
  181. data/lib/chef/mixin/shell_out.rb +38 -0
  182. data/lib/chef/mixin/template.rb +95 -0
  183. data/lib/chef/mixin/xml_escape.rb +140 -0
  184. data/lib/chef/mixins.rb +16 -0
  185. data/lib/chef/monkey_patches/dir.rb +36 -0
  186. data/lib/chef/monkey_patches/string.rb +28 -0
  187. data/lib/chef/monkey_patches/tempfile.rb +64 -0
  188. data/lib/chef/node/attribute.rb +465 -0
  189. data/lib/chef/node.rb +601 -0
  190. data/lib/chef/openid_registration.rb +187 -0
  191. data/lib/chef/platform.rb +371 -0
  192. data/lib/chef/provider/breakpoint.rb +36 -0
  193. data/lib/chef/provider/cookbook_file.rb +100 -0
  194. data/lib/chef/provider/cron/solaris.rb +195 -0
  195. data/lib/chef/provider/cron.rb +186 -0
  196. data/lib/chef/provider/deploy/revision.rb +73 -0
  197. data/lib/chef/provider/deploy/timestamped.rb +33 -0
  198. data/lib/chef/provider/deploy.rb +319 -0
  199. data/lib/chef/provider/directory.rb +72 -0
  200. data/lib/chef/provider/env/windows.rb +75 -0
  201. data/lib/chef/provider/env.rb +152 -0
  202. data/lib/chef/provider/erl_call.rb +72 -0
  203. data/lib/chef/provider/execute.rb +58 -0
  204. data/lib/chef/provider/file.rb +213 -0
  205. data/lib/chef/provider/git.rb +211 -0
  206. data/lib/chef/provider/group/dscl.rb +121 -0
  207. data/lib/chef/provider/group/gpasswd.rb +53 -0
  208. data/lib/chef/provider/group/groupadd.rb +78 -0
  209. data/lib/chef/provider/group/pw.rb +84 -0
  210. data/lib/chef/provider/group/usermod.rb +57 -0
  211. data/lib/chef/provider/group/windows.rb +79 -0
  212. data/lib/chef/provider/group.rb +133 -0
  213. data/lib/chef/provider/http_request.rb +122 -0
  214. data/lib/chef/provider/ifconfig.rb +132 -0
  215. data/lib/chef/provider/link.rb +161 -0
  216. data/lib/chef/provider/log.rb +54 -0
  217. data/lib/chef/provider/mdadm.rb +91 -0
  218. data/lib/chef/provider/mount/mount.rb +232 -0
  219. data/lib/chef/provider/mount/windows.rb +80 -0
  220. data/lib/chef/provider/mount.rb +117 -0
  221. data/lib/chef/provider/ohai.rb +41 -0
  222. data/lib/chef/provider/package/apt.rb +110 -0
  223. data/lib/chef/provider/package/dpkg.rb +112 -0
  224. data/lib/chef/provider/package/easy_install.rb +114 -0
  225. data/lib/chef/provider/package/freebsd.rb +123 -0
  226. data/lib/chef/provider/package/macports.rb +105 -0
  227. data/lib/chef/provider/package/pacman.rb +101 -0
  228. data/lib/chef/provider/package/portage.rb +124 -0
  229. data/lib/chef/provider/package/rpm.rb +101 -0
  230. data/lib/chef/provider/package/rubygems.rb +462 -0
  231. data/lib/chef/provider/package/solaris.rb +127 -0
  232. data/lib/chef/provider/package/yum-dump.py +128 -0
  233. data/lib/chef/provider/package/yum.rb +222 -0
  234. data/lib/chef/provider/package/zypper.rb +133 -0
  235. data/lib/chef/provider/package.rb +160 -0
  236. data/lib/chef/provider/remote_directory.rb +140 -0
  237. data/lib/chef/provider/remote_file.rb +120 -0
  238. data/lib/chef/provider/route.rb +195 -0
  239. data/lib/chef/provider/ruby_block.rb +33 -0
  240. data/lib/chef/provider/script.rb +55 -0
  241. data/lib/chef/provider/service/arch.rb +109 -0
  242. data/lib/chef/provider/service/debian.rb +105 -0
  243. data/lib/chef/provider/service/freebsd.rb +156 -0
  244. data/lib/chef/provider/service/gentoo.rb +54 -0
  245. data/lib/chef/provider/service/init.rb +71 -0
  246. data/lib/chef/provider/service/redhat.rb +60 -0
  247. data/lib/chef/provider/service/simple.rb +118 -0
  248. data/lib/chef/provider/service/solaris.rb +85 -0
  249. data/lib/chef/provider/service/upstart.rb +192 -0
  250. data/lib/chef/provider/service/windows.rb +129 -0
  251. data/lib/chef/provider/service.rb +128 -0
  252. data/lib/chef/provider/subversion.rb +159 -0
  253. data/lib/chef/provider/template.rb +105 -0
  254. data/lib/chef/provider/user/dscl.rb +280 -0
  255. data/lib/chef/provider/user/pw.rb +113 -0
  256. data/lib/chef/provider/user/useradd.rb +137 -0
  257. data/lib/chef/provider/user/windows.rb +124 -0
  258. data/lib/chef/provider/user.rb +187 -0
  259. data/lib/chef/provider.rb +124 -0
  260. data/lib/chef/providers.rb +91 -0
  261. data/lib/chef/recipe.rb +130 -0
  262. data/lib/chef/resource/apt_package.rb +34 -0
  263. data/lib/chef/resource/bash.rb +33 -0
  264. data/lib/chef/resource/breakpoint.rb +35 -0
  265. data/lib/chef/resource/cookbook_file.rb +45 -0
  266. data/lib/chef/resource/cron.rb +188 -0
  267. data/lib/chef/resource/csh.rb +33 -0
  268. data/lib/chef/resource/deploy.rb +371 -0
  269. data/lib/chef/resource/deploy_revision.rb +35 -0
  270. data/lib/chef/resource/directory.rb +76 -0
  271. data/lib/chef/resource/dpkg_package.rb +34 -0
  272. data/lib/chef/resource/easy_install_package.rb +41 -0
  273. data/lib/chef/resource/env.rb +58 -0
  274. data/lib/chef/resource/erl_call.rb +83 -0
  275. data/lib/chef/resource/execute.rb +127 -0
  276. data/lib/chef/resource/file.rb +92 -0
  277. data/lib/chef/resource/freebsd_package.rb +35 -0
  278. data/lib/chef/resource/gem_package.rb +49 -0
  279. data/lib/chef/resource/git.rb +36 -0
  280. data/lib/chef/resource/group.rb +70 -0
  281. data/lib/chef/resource/http_request.rb +61 -0
  282. data/lib/chef/resource/ifconfig.rb +134 -0
  283. data/lib/chef/resource/link.rb +78 -0
  284. data/lib/chef/resource/log.rb +62 -0
  285. data/lib/chef/resource/macports_package.rb +29 -0
  286. data/lib/chef/resource/mdadm.rb +82 -0
  287. data/lib/chef/resource/mount.rb +135 -0
  288. data/lib/chef/resource/ohai.rb +40 -0
  289. data/lib/chef/resource/package.rb +80 -0
  290. data/lib/chef/resource/pacman_package.rb +33 -0
  291. data/lib/chef/resource/perl.rb +33 -0
  292. data/lib/chef/resource/portage_package.rb +33 -0
  293. data/lib/chef/resource/python.rb +33 -0
  294. data/lib/chef/resource/remote_directory.rb +109 -0
  295. data/lib/chef/resource/remote_file.rb +83 -0
  296. data/lib/chef/resource/route.rb +135 -0
  297. data/lib/chef/resource/rpm_package.rb +34 -0
  298. data/lib/chef/resource/ruby.rb +33 -0
  299. data/lib/chef/resource/ruby_block.rb +40 -0
  300. data/lib/chef/resource/scm.rb +146 -0
  301. data/lib/chef/resource/script.rb +60 -0
  302. data/lib/chef/resource/service.rb +160 -0
  303. data/lib/chef/resource/solaris_package.rb +36 -0
  304. data/lib/chef/resource/subversion.rb +36 -0
  305. data/lib/chef/resource/template.rb +69 -0
  306. data/lib/chef/resource/timestamped_deploy.rb +31 -0
  307. data/lib/chef/resource/user.rb +130 -0
  308. data/lib/chef/resource/yum_package.rb +43 -0
  309. data/lib/chef/resource.rb +523 -0
  310. data/lib/chef/resource_collection/stepable_iterator.rb +124 -0
  311. data/lib/chef/resource_collection.rb +217 -0
  312. data/lib/chef/resource_definition.rb +67 -0
  313. data/lib/chef/resource_definition_list.rb +38 -0
  314. data/lib/chef/resources.rb +64 -0
  315. data/lib/chef/rest/auth_credentials.rb +78 -0
  316. data/lib/chef/rest/cookie_jar.rb +31 -0
  317. data/lib/chef/rest/rest_request.rb +188 -0
  318. data/lib/chef/rest.rb +394 -0
  319. data/lib/chef/role.rb +287 -0
  320. data/lib/chef/run_context.rb +110 -0
  321. data/lib/chef/run_list/run_list_expansion.rb +172 -0
  322. data/lib/chef/run_list/run_list_item.rb +78 -0
  323. data/lib/chef/run_list.rb +150 -0
  324. data/lib/chef/run_status.rb +121 -0
  325. data/lib/chef/runner.rb +107 -0
  326. data/lib/chef/sandbox.rb +153 -0
  327. data/lib/chef/search/query.rb +60 -0
  328. data/lib/chef/shef/ext.rb +568 -0
  329. data/lib/chef/shef/model_wrapper.rb +120 -0
  330. data/lib/chef/shef/shef_rest.rb +28 -0
  331. data/lib/chef/shef/shef_session.rb +271 -0
  332. data/lib/chef/shef.rb +325 -0
  333. data/lib/chef/shell_out.rb +413 -0
  334. data/lib/chef/streaming_cookbook_uploader.rb +201 -0
  335. data/lib/chef/tasks/chef_repo.rake +256 -0
  336. data/lib/chef/util/file_edit.rb +122 -0
  337. data/lib/chef/util/windows/net_group.rb +101 -0
  338. data/lib/chef/util/windows/net_use.rb +121 -0
  339. data/lib/chef/util/windows/net_user.rb +198 -0
  340. data/lib/chef/util/windows/volume.rb +59 -0
  341. data/lib/chef/util/windows.rb +56 -0
  342. data/lib/chef/version.rb +21 -0
  343. data/lib/chef/webui_user.rb +231 -0
  344. data/lib/chef.rb +39 -0
  345. metadata +533 -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,832 @@
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 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
+ ## EC2 SUB-COMMANDS
546
+
547
+ 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.
548
+
549
+ __ec2 instance data [RUN LIST...]__ _(options)_
550
+
551
+ * `-e`, `--edit`:
552
+ Edit the instance data
553
+
554
+ 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.
555
+
556
+ __ec2 server create [RUN LIST...]__ _(options)_
557
+
558
+ * `-Z`, `--availability-zone ZONE`:
559
+ The Availability Zone
560
+ * `--region`:
561
+ Your AWS region
562
+ * `-A`, `--aws-access-key-id KEY `:
563
+ Your AWS Access Key ID
564
+ * `-K SECRET`, `--aws-secret-access-key`:
565
+ Your AWS API Secret Access Key
566
+ * `-f`, `--flavor FLAVOR`:
567
+ The flavor of server (m1.small, m1.medium, etc)
568
+ * `-i`, `--image IMAGE`:
569
+ The AMI for the server
570
+ * `-G`, `--groups X,Y,Z `:
571
+ The security groups for this server
572
+ * `-S`, `--ssh-key KEY `:
573
+ The SSH root key, corresponds to an Amazon Keypair.
574
+ * `-I`, `--identity-file IDENTITY_FILE`:
575
+ The SSH identity file used for authentication, passed to `bootstrap`.
576
+ * `-P`, `--ssh-password PASSWORD`:
577
+ The ssh password, passed to `bootstrap`.
578
+ * `-x`, `--ssh-user USERNAME`:
579
+ The ssh username, passed to `bootstrap`.
580
+ * `--prerelease`:
581
+ Install pre-release Chef gems, passed to `bootstrap`.
582
+ * `--template-file TEMPLATE`:
583
+ Full path to location of template to use, passed to `bootstrap`.
584
+ * `-d`, `--distro DISTRO`:
585
+ Bootstrap a distro using a template, passed to `bootstrap`.
586
+
587
+ 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.
588
+
589
+ __ec2 server delete SERVER [SERVER]__ _(options)_
590
+
591
+ * `-A`, `--aws-access-key-id KEY`:
592
+ Your AWS Access Key ID
593
+ * `-K SECRET`, `--aws-secret-access-key`:
594
+ Your AWS API Secret Access Key
595
+
596
+ Terminates a running Amazon AWS EC2 instance.
597
+
598
+ __ec2 server list [RUN LIST...]__ _(options)_
599
+
600
+ * `-A`, `--aws-access-key-id KEY`:
601
+ Your AWS Access Key ID
602
+ * `-K SECRET`, `--aws-secret-access-key`:
603
+ Your AWS API Secret Access Key
604
+
605
+ List running Amazon AWS EC2 instances.
606
+
607
+ ## RACKSPACE SUB-COMMANDS
608
+
609
+ 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.
610
+
611
+ __rackspace server create [RUN LIST...]__ _(options)_
612
+
613
+ * `-K`, `--rackspace-api-key KEY`:
614
+ Your rackspace API key
615
+ * `-A USERNAME`, `--rackspace-api-username`:
616
+ Your rackspace API username
617
+ * `-f`, `--flavor FLAVOR `:
618
+ The flavor of server
619
+ * `-i`, `--image IMAGE `:
620
+ The image of the server
621
+ * `-N`, `--server-name NAME`:
622
+ The server name
623
+
624
+ Creates a new Rackspace Cloud server.
625
+
626
+ __rackspace server delete SERVER__ _(options)_
627
+
628
+ Deletes a running Rackspace Cloud server.
629
+
630
+ __rackspace server list__ _(options)_
631
+
632
+ Lists running Rackspace Cloud servers.
633
+
634
+ ## SLICEHOST SUB-COMMANDS
635
+
636
+ As above, Chef can also be used on Slicehost nodes. The following sub-commands allow manipulating Slicehost nodes via the `fog` library.
637
+
638
+ __slicehost server create [RUN LIST...]__ _(options)_
639
+ * `-f`, `--flavor FLAVOR`:
640
+ The flavor of server
641
+ * `-i`, `--image IMAGE`:
642
+ The image of the server
643
+ * `-N`, `--server-name NAME`:
644
+ The server name
645
+ * `-K`, `--slicehost-password PASSWORD`:
646
+ Your slicehost API password
647
+
648
+ Creates a new slicehost server.
649
+
650
+ __slicehost server list__ _(options)_
651
+
652
+ Lists running Slicehost servers.
653
+
654
+ __slicehost server delete SLICENAME__
655
+
656
+ Deletes a running Slicehost server.
657
+
658
+ __slicehost images list__
659
+
660
+ Lists the available Slicehost server images to boot.
661
+
662
+ ## TERREMARK SUB-COMMANDS
663
+
664
+ As above, Chef can also be used on Terremark vCloud nodes. The following sub-commands allow manipulating Terremark vCloud nodes via the `fog` library.
665
+
666
+ __terremark server create NAME [RUN LIST...]__ _(options)_
667
+
668
+ * `-K PASSWORD`, `--terremark-password`:
669
+ Your terremark password
670
+ * `-S`, `--terremark-service SERVICE`:
671
+ Your terremark service name
672
+ * `-A USERNAME`, `--terremark-username`:
673
+ Your terremark username
674
+
675
+ Creates a new Terremark vCloud server.
676
+
677
+ __terremark server delete SERVER__ _(options)_
678
+
679
+ Deletes a running Terremark vCloud server.
680
+
681
+ __terremark server list__ _(options)_
682
+
683
+ * `-K PASSWORD`, `--terremark-password`:
684
+ Your terremark password
685
+ * `-S`, `--terremark-service SERVICE`:
686
+ Your terremark service name
687
+ * `-A USERNAME`, `--terremark-username`:
688
+ Your terremark username
689
+
690
+ Lists running Terremark vCloud servers.
691
+
692
+ ## CONFIGURATION
693
+
694
+ 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.
695
+
696
+ If the config file exists, knife uses these settings for __GENERAL OPTIONS__ defaults.
697
+
698
+ `log_level`
699
+
700
+ A Ruby symbol specifying the log level. Corresponds to `-l` or `--log_level` option. Default is _:info_. Valid values are:
701
+
702
+ * :info
703
+ * :debug
704
+ * :warn
705
+ * :fatal
706
+
707
+ `log_location`
708
+
709
+ Corresponds to the `-L` or `--log-file` option. Defaults is __STDOUT__. Valid values are __STDOUT__ or a filename.
710
+
711
+ `node_name`
712
+
713
+ 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.
714
+
715
+ `client_key`
716
+
717
+ 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.
718
+
719
+ `chef_server_url`
720
+
721
+ URL of the Chef server. Corresponds to the `-s` or `--server-url` option. This is requested from the user when running this sub-command.
722
+
723
+ `cache_type`
724
+
725
+ 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.
726
+
727
+ `cache_options`
728
+
729
+ Specifies various options to use for caching. Default reads the Chef client configuration (/etc/chef/checksums).
730
+
731
+ `validation_client_name`
732
+
733
+ Specifies the name of the client used to validate new clients. This is requested from the user when running the configuration sub-command.
734
+
735
+ `validation_key`
736
+
737
+ Specifies the private key file to use for generating ec2 instance data for validating new clients. This is implied from the `validation_client_name`.
738
+
739
+ `cookbook_copyright`
740
+ `cookbook_email`
741
+ `cookbook_license`
742
+
743
+ 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.
744
+
745
+ `knife[:aws_access_key_id]`
746
+ `knife[:aws_secret_access_key]`
747
+
748
+ Specifies the Amazon AWS EC2 credentials to use when running the ec2 sub-commands.
749
+
750
+ `knife[:rackspace_api_username]`
751
+ `knife[:rackspace_api_key]`
752
+
753
+ Specifies the Rackspace Cloud credentials to use when running the rackspace sub-commands.
754
+
755
+ `knife[:terremark_username]`
756
+ `knife[:terremark_password]`
757
+ `knife[:terremark_service]`
758
+
759
+ Specifies the Terremark vCloud credentials to use when running the terremark sub-commands.
760
+
761
+ `knife[:slicehost_password]`
762
+
763
+ Specifies the Slicehost password to use when running the slicdehost sub-commands.
764
+
765
+ ## FILES
766
+
767
+ _~/.chef/knife.rb_
768
+
769
+ Ruby DSL configuration file for knife. See __CONFIGURATION__.
770
+
771
+ ## CHEF WORKFLOW
772
+
773
+ When working with Chef and Knife in the local repository, the recommended workflow outline looks like:
774
+
775
+ * Create repository. A skeleton sample is provided at _http://github.com/opscode/chef-repo/_.
776
+ * Configure knife, see __CONFIGURATION__.
777
+ * Download cookbooks from the Opscode cookbooks site, see __COOKBOOK SITE SUB-COMMANDS__.
778
+ * Or, create new cookbooks, see `cookbook create` sub-command.
779
+ * Commit changes to the version control system. See your tool's documentation.
780
+ * Upload cookbooks to the Chef Server, see __COOKBOOK SUB-COMMANDS__.
781
+ * Launch instances in the Cloud, OR provision new hosts; see __CLOUD COMPUTING SUB-COMMANDS__ and __BOOTSTRAP SUB-COMMANDS__.
782
+ * Watch Chef configure systems!
783
+
784
+ 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.
785
+
786
+ ## EXAMPLES
787
+
788
+ 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.
789
+
790
+ log_level :info
791
+ log_location STDOUT
792
+ chef_server_url 'https://api.opscode.com/organizations/ORGNAME'
793
+ validation_client_name 'ORGNAME-validator'
794
+
795
+ 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.
796
+
797
+ mkdir ~/.chef/bootstrap
798
+ vi ~/.chef/bootstrap/debian5.0-apt.erb
799
+
800
+ 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:
801
+
802
+ knife bootstrap mynode.example.com --template-file ~/.chef/bootstrap/debian5.0-apt.erb
803
+
804
+ Or,
805
+
806
+ knife bootstrap mynode.example.com --distro debian5.0-apt
807
+
808
+ The `--distro` parameter will automatically look in the `~/.chef/bootstrap` directory for a file named `debian5.0-apt.erb`.
809
+
810
+ 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.
811
+
812
+ Uploading cookbooks to the Opscode cookbooks site using the user/certificate specifically:
813
+
814
+ knife cookbook site share example Other -k ~/.chef/USERNAME.pem -u USERNAME
815
+
816
+ ## SEE ALSO
817
+
818
+ Full documentation for Chef is located on the Chef wiki, http://wiki.opscode.com/display/chef/Home/.
819
+
820
+ JSON is JavaScript Object Notation and more information can be found at http://json.org/.
821
+
822
+ 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/.
823
+
824
+ Git is a version control system and documented at http://git-scm.com/.
825
+
826
+ 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.
827
+
828
+ ## AUTHOR
829
+
830
+ 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.
831
+
832
+ On Debian systems, the complete text of the Apache 2.0 License can be found in `/usr/share/common-licenses/Apache-2.0`.