chef 13.11.3 → 13.12.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -3
- data/README.md +35 -40
- data/Rakefile +18 -22
- data/chef-universal-mingw32.gemspec +1 -1
- data/chef.gemspec +3 -3
- data/lib/chef/client.rb +1 -1
- data/lib/chef/mixin/params_validate.rb +3 -1
- data/lib/chef/provider/script.rb +2 -2
- data/lib/chef/version.rb +1 -1
- data/spec/functional/http/simple_spec.rb +12 -6
- data/spec/functional/resource/remote_file_spec.rb +19 -15
- data/spec/support/platform_helpers.rb +2 -1
- data/tasks/announce.rb +1 -1
- data/tasks/dependencies.rb +5 -39
- data/tasks/maintainers.rb +10 -10
- data/tasks/rspec.rb +2 -2
- data/tasks/templates/prerelease.md.erb +11 -2
- data/tasks/templates/release.md.erb +9 -1
- metadata +6 -248
- data/CONTRIBUTING.md +0 -151
- data/VERSION +0 -1
- data/acceptance/.gitignore +0 -3
- data/acceptance/.shared/kitchen_acceptance/.kitchen.digitalocean.yml +0 -33
- data/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml +0 -283
- data/acceptance/.shared/kitchen_acceptance/.kitchen.vagrant.yml +0 -59
- data/acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb +0 -68
- data/acceptance/.shared/kitchen_acceptance/metadata.rb +0 -1
- data/acceptance/Gemfile +0 -19
- data/acceptance/Gemfile.lock +0 -266
- data/acceptance/README.md +0 -137
- data/acceptance/basics/.acceptance/acceptance-cookbook/.gitignore +0 -2
- data/acceptance/basics/.acceptance/acceptance-cookbook/metadata.rb +0 -3
- data/acceptance/basics/.acceptance/acceptance-cookbook/recipes/destroy.rb +0 -1
- data/acceptance/basics/.acceptance/acceptance-cookbook/recipes/provision.rb +0 -1
- data/acceptance/basics/.acceptance/acceptance-cookbook/recipes/verify.rb +0 -1
- data/acceptance/basics/.kitchen.yml +0 -4
- data/acceptance/basics/test/integration/chef-current-install/serverspec/chef_client_spec.rb +0 -19
- data/acceptance/basics/test/integration/chef-current-install/serverspec/spec_helper.rb +0 -6
- data/acceptance/basics/test/integration/helpers/serverspec/Gemfile +0 -8
- data/acceptance/data-collector/.acceptance/acceptance-cookbook/.gitignore +0 -2
- data/acceptance/data-collector/.acceptance/acceptance-cookbook/metadata.rb +0 -3
- data/acceptance/data-collector/.acceptance/acceptance-cookbook/recipes/destroy.rb +0 -2
- data/acceptance/data-collector/.acceptance/acceptance-cookbook/recipes/provision.rb +0 -2
- data/acceptance/data-collector/.acceptance/acceptance-cookbook/recipes/verify.rb +0 -2
- data/acceptance/data-collector/.acceptance/data-collector-test/.gitignore +0 -16
- data/acceptance/data-collector/.acceptance/data-collector-test/Berksfile +0 -3
- data/acceptance/data-collector/.acceptance/data-collector-test/files/default/api.rb +0 -101
- data/acceptance/data-collector/.acceptance/data-collector-test/files/default/apigemfile +0 -3
- data/acceptance/data-collector/.acceptance/data-collector-test/files/default/client-rb-both-mode.rb +0 -4
- data/acceptance/data-collector/.acceptance/data-collector-test/files/default/client-rb-client-mode.rb +0 -4
- data/acceptance/data-collector/.acceptance/data-collector-test/files/default/client-rb-no-endpoint.rb +0 -2
- data/acceptance/data-collector/.acceptance/data-collector-test/files/default/client-rb-solo-mode.rb +0 -4
- data/acceptance/data-collector/.acceptance/data-collector-test/files/default/config.ru +0 -2
- data/acceptance/data-collector/.acceptance/data-collector-test/metadata.rb +0 -7
- data/acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb +0 -44
- data/acceptance/data-collector/.kitchen.yml +0 -9
- data/acceptance/data-collector/Berksfile +0 -3
- data/acceptance/data-collector/test/integration/default/serverspec/default_spec.rb +0 -208
- data/acceptance/data-collector/test/integration/helpers/serverspec/Gemfile +0 -8
- data/acceptance/omnitruck/.acceptance/acceptance-cookbook/.gitignore +0 -2
- data/acceptance/omnitruck/.acceptance/acceptance-cookbook/metadata.rb +0 -1
- data/acceptance/omnitruck/.acceptance/acceptance-cookbook/recipes/destroy.rb +0 -1
- data/acceptance/omnitruck/.acceptance/acceptance-cookbook/recipes/provision.rb +0 -1
- data/acceptance/omnitruck/.acceptance/acceptance-cookbook/recipes/verify.rb +0 -61
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/.gitignore +0 -2
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/cookbook_kitchen.rb +0 -43
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/top_cookbooks.rb +0 -41
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/metadata.rb +0 -3
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/destroy.rb +0 -1
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/provision.rb +0 -1
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/verify.rb +0 -1
- data/acceptance/top-cookbooks/.gitignore +0 -1
- data/acceptance/top-cookbooks/.kitchen.chocolatey.yml +0 -6
- data/acceptance/top-cookbooks/.kitchen.iis.yml +0 -4
- data/acceptance/top-cookbooks/.kitchen.learn-the-basics-rhel.yml +0 -7
- data/acceptance/top-cookbooks/.kitchen.learn-the-basics-ubuntu.yml +0 -7
- data/acceptance/top-cookbooks/.kitchen.learn-the-basics-windows.yml +0 -7
- data/acceptance/top-cookbooks/.kitchen.powershell.yml +0 -4
- data/acceptance/top-cookbooks/.kitchen.sql_server.yml +0 -5
- data/acceptance/top-cookbooks/.kitchen.winbox.yml +0 -8
- data/acceptance/top-cookbooks/.kitchen.windows.yml +0 -38
- data/acceptance/trivial/.acceptance/acceptance-cookbook/.gitignore +0 -2
- data/acceptance/trivial/.acceptance/acceptance-cookbook/metadata.rb +0 -2
- data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/destroy.rb +0 -1
- data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/provision.rb +0 -1
- data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/verify.rb +0 -1
- data/acceptance/trivial/.kitchen.yml +0 -7
- data/acceptance/trivial/test/integration/chef-current-install/inspec/chef_client_spec.rb +0 -5
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/.gitignore +0 -2
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/metadata.rb +0 -2
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/destroy.rb +0 -1
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/provision.rb +0 -1
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/verify.rb +0 -1
- data/acceptance/windows-service/.kitchen.yml +0 -7
- data/acceptance/windows-service/test/integration/chef-windows-service/inspec/chef_windows_service_spec.rb +0 -58
- data/distro/common/html/_sources/ctl_chef_client.txt +0 -36
- data/distro/common/html/_sources/ctl_chef_server.txt +0 -341
- data/distro/common/html/_sources/ctl_chef_shell.txt +0 -15
- data/distro/common/html/_sources/ctl_chef_solo.txt +0 -25
- data/distro/common/html/_sources/index.txt +0 -135
- data/distro/common/html/_sources/knife.txt +0 -74
- data/distro/common/html/_sources/knife_bootstrap.txt +0 -56
- data/distro/common/html/_sources/knife_client.txt +0 -151
- data/distro/common/html/_sources/knife_common_options.txt +0 -6
- data/distro/common/html/_sources/knife_configure.txt +0 -29
- data/distro/common/html/_sources/knife_cookbook.txt +0 -236
- data/distro/common/html/_sources/knife_cookbook_site.txt +0 -157
- data/distro/common/html/_sources/knife_data_bag.txt +0 -160
- data/distro/common/html/_sources/knife_delete.txt +0 -26
- data/distro/common/html/_sources/knife_deps.txt +0 -61
- data/distro/common/html/_sources/knife_diff.txt +0 -34
- data/distro/common/html/_sources/knife_download.txt +0 -44
- data/distro/common/html/_sources/knife_edit.txt +0 -26
- data/distro/common/html/_sources/knife_environment.txt +0 -158
- data/distro/common/html/_sources/knife_exec.txt +0 -47
- data/distro/common/html/_sources/knife_index_rebuild.txt +0 -21
- data/distro/common/html/_sources/knife_list.txt +0 -33
- data/distro/common/html/_sources/knife_node.txt +0 -250
- data/distro/common/html/_sources/knife_raw.txt +0 -35
- data/distro/common/html/_sources/knife_recipe_list.txt +0 -23
- data/distro/common/html/_sources/knife_role.txt +0 -157
- data/distro/common/html/_sources/knife_search.txt +0 -53
- data/distro/common/html/_sources/knife_serve.txt +0 -19
- data/distro/common/html/_sources/knife_show.txt +0 -27
- data/distro/common/html/_sources/knife_ssh.txt +0 -43
- data/distro/common/html/_sources/knife_ssl_check.txt +0 -41
- data/distro/common/html/_sources/knife_ssl_fetch.txt +0 -41
- data/distro/common/html/_sources/knife_status.txt +0 -37
- data/distro/common/html/_sources/knife_tag.txt +0 -69
- data/distro/common/html/_sources/knife_upload.txt +0 -49
- data/distro/common/html/_sources/knife_user.txt +0 -127
- data/distro/common/html/_sources/knife_using.txt +0 -43
- data/distro/common/html/_sources/knife_xargs.txt +0 -30
- data/distro/common/html/_static/ajax-loader.gif +0 -0
- data/distro/common/html/_static/basic.css +0 -537
- data/distro/common/html/_static/chef.ico +0 -0
- data/distro/common/html/_static/chef_html_logo.png +0 -0
- data/distro/common/html/_static/comment-bright.png +0 -0
- data/distro/common/html/_static/comment-close.png +0 -0
- data/distro/common/html/_static/comment.png +0 -0
- data/distro/common/html/_static/contents.png +0 -0
- data/distro/common/html/_static/doctools.js +0 -238
- data/distro/common/html/_static/down-pressed.png +0 -0
- data/distro/common/html/_static/down.png +0 -0
- data/distro/common/html/_static/file.png +0 -0
- data/distro/common/html/_static/guide.css +0 -505
- data/distro/common/html/_static/jquery.js +0 -2
- data/distro/common/html/_static/minus.png +0 -0
- data/distro/common/html/_static/navigation.png +0 -0
- data/distro/common/html/_static/plus.png +0 -0
- data/distro/common/html/_static/pygments.css +0 -62
- data/distro/common/html/_static/searchtools.js +0 -622
- data/distro/common/html/_static/underscore.js +0 -31
- data/distro/common/html/_static/up-pressed.png +0 -0
- data/distro/common/html/_static/up.png +0 -0
- data/distro/common/html/_static/websupport.js +0 -808
- data/distro/common/html/ctl_chef_client.html +0 -270
- data/distro/common/html/ctl_chef_server.html +0 -728
- data/distro/common/html/ctl_chef_shell.html +0 -163
- data/distro/common/html/ctl_chef_solo.html +0 -194
- data/distro/common/html/index.html +0 -202
- data/distro/common/html/knife.html +0 -170
- data/distro/common/html/knife_bootstrap.html +0 -285
- data/distro/common/html/knife_client.html +0 -285
- data/distro/common/html/knife_common_options.html +0 -96
- data/distro/common/html/knife_configure.html +0 -105
- data/distro/common/html/knife_cookbook.html +0 -487
- data/distro/common/html/knife_cookbook_site.html +0 -375
- data/distro/common/html/knife_data_bag.html +0 -374
- data/distro/common/html/knife_delete.html +0 -93
- data/distro/common/html/knife_deps.html +0 -143
- data/distro/common/html/knife_diff.html +0 -123
- data/distro/common/html/knife_download.html +0 -145
- data/distro/common/html/knife_edit.html +0 -89
- data/distro/common/html/knife_environment.html +0 -322
- data/distro/common/html/knife_exec.html +0 -220
- data/distro/common/html/knife_index_rebuild.html +0 -83
- data/distro/common/html/knife_list.html +0 -114
- data/distro/common/html/knife_node.html +0 -458
- data/distro/common/html/knife_raw.html +0 -110
- data/distro/common/html/knife_recipe_list.html +0 -91
- data/distro/common/html/knife_role.html +0 -295
- data/distro/common/html/knife_search.html +0 -203
- data/distro/common/html/knife_serve.html +0 -79
- data/distro/common/html/knife_show.html +0 -104
- data/distro/common/html/knife_ssh.html +0 -177
- data/distro/common/html/knife_ssl_check.html +0 -151
- data/distro/common/html/knife_ssl_fetch.html +0 -151
- data/distro/common/html/knife_status.html +0 -144
- data/distro/common/html/knife_tag.html +0 -138
- data/distro/common/html/knife_upload.html +0 -153
- data/distro/common/html/knife_user.html +0 -242
- data/distro/common/html/knife_using.html +0 -210
- data/distro/common/html/knife_xargs.html +0 -122
- data/distro/common/html/objects.inv +0 -0
- data/distro/common/html/search.html +0 -82
- data/distro/common/html/searchindex.js +0 -1
- data/distro/common/man/man1/README.md +0 -58
- data/distro/common/man/man1/chef-shell.1 +0 -194
- data/distro/common/man/man1/knife-bootstrap.1 +0 -215
- data/distro/common/man/man1/knife-client.1 +0 -443
- data/distro/common/man/man1/knife-configure.1 +0 -161
- data/distro/common/man/man1/knife-cookbook-site.1 +0 -552
- data/distro/common/man/man1/knife-cookbook.1 +0 -770
- data/distro/common/man/man1/knife-data-bag.1 +0 -617
- data/distro/common/man/man1/knife-delete.1 +0 -127
- data/distro/common/man/man1/knife-deps.1 +0 -246
- data/distro/common/man/man1/knife-diff.1 +0 -226
- data/distro/common/man/man1/knife-download.1 +0 -258
- data/distro/common/man/man1/knife-edit.1 +0 -121
- data/distro/common/man/man1/knife-environment.1 +0 -496
- data/distro/common/man/man1/knife-exec.1 +0 -362
- data/distro/common/man/man1/knife-index-rebuild.1 +0 -63
- data/distro/common/man/man1/knife-list.1 +0 -174
- data/distro/common/man/man1/knife-node.1 +0 -716
- data/distro/common/man/man1/knife-raw.1 +0 -172
- data/distro/common/man/man1/knife-recipe-list.1 +0 -85
- data/distro/common/man/man1/knife-role.1 +0 -426
- data/distro/common/man/man1/knife-search.1 +0 -359
- data/distro/common/man/man1/knife-serve.1 +0 -109
- data/distro/common/man/man1/knife-show.1 +0 -160
- data/distro/common/man/man1/knife-ssh.1 +0 -284
- data/distro/common/man/man1/knife-ssl-check.1 +0 -207
- data/distro/common/man/man1/knife-ssl-fetch.1 +0 -207
- data/distro/common/man/man1/knife-status.1 +0 -234
- data/distro/common/man/man1/knife-tag.1 +0 -189
- data/distro/common/man/man1/knife-upload.1 +0 -280
- data/distro/common/man/man1/knife-user.1 +0 -356
- data/distro/common/man/man1/knife-xargs.1 +0 -189
- data/distro/common/man/man1/knife.1 +0 -332
- data/distro/common/man/man8/chef-apply.8 +0 -86
- data/distro/common/man/man8/chef-client.8 +0 -398
- data/distro/common/man/man8/chef-solo.8 +0 -260
- data/distro/common/markdown/README +0 -3
- data/distro/common/markdown/man1/chef-shell.mkd +0 -195
- data/distro/common/markdown/man1/knife-bootstrap.mkd +0 -141
- data/distro/common/markdown/man1/knife-client.mkd +0 -103
- data/distro/common/markdown/man1/knife-configure.mkd +0 -71
- data/distro/common/markdown/man1/knife-cookbook-site.mkd +0 -123
- data/distro/common/markdown/man1/knife-cookbook.mkd +0 -263
- data/distro/common/markdown/man1/knife-data-bag.mkd +0 -121
- data/distro/common/markdown/man1/knife-environment.mkd +0 -151
- data/distro/common/markdown/man1/knife-exec.mkd +0 -42
- data/distro/common/markdown/man1/knife-index.mkd +0 -30
- data/distro/common/markdown/man1/knife-node.mkd +0 -130
- data/distro/common/markdown/man1/knife-role.mkd +0 -85
- data/distro/common/markdown/man1/knife-search.mkd +0 -180
- data/distro/common/markdown/man1/knife-ssh.mkd +0 -69
- data/distro/common/markdown/man1/knife-status.mkd +0 -36
- data/distro/common/markdown/man1/knife-tag.mkd +0 -39
- data/distro/common/markdown/man1/knife.mkd +0 -213
- data/distro/common/markdown/man8/chef-client.mkd +0 -75
- data/distro/common/markdown/man8/chef-expander.mkd +0 -81
- data/distro/common/markdown/man8/chef-expanderctl.mkd +0 -57
- data/distro/common/markdown/man8/chef-server-webui.mkd +0 -121
- data/distro/common/markdown/man8/chef-server.mkd +0 -120
- data/distro/common/markdown/man8/chef-solo.mkd +0 -107
- data/distro/common/markdown/man8/chef-solr.mkd +0 -89
- data/distro/powershell/chef/chef.psm1 +0 -459
- data/tasks/cbgb.rb +0 -84
@@ -1,203 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
|
4
|
-
|
5
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
6
|
-
<head>
|
7
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
8
|
-
|
9
|
-
<title>knife search — chef-client Man Pages</title>
|
10
|
-
|
11
|
-
<link rel="stylesheet" href="_static/guide.css" type="text/css" />
|
12
|
-
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
13
|
-
|
14
|
-
<script type="text/javascript">
|
15
|
-
var DOCUMENTATION_OPTIONS = {
|
16
|
-
URL_ROOT: './',
|
17
|
-
VERSION: '',
|
18
|
-
COLLAPSE_INDEX: false,
|
19
|
-
FILE_SUFFIX: '.html',
|
20
|
-
HAS_SOURCE: true
|
21
|
-
};
|
22
|
-
</script>
|
23
|
-
<script type="text/javascript" src="_static/jquery.js"></script>
|
24
|
-
<script type="text/javascript" src="_static/underscore.js"></script>
|
25
|
-
<script type="text/javascript" src="_static/doctools.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px">
|
31
|
-
<a href="http://docs.getchef.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a>
|
32
|
-
</div>
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
<div class="document">
|
38
|
-
<div class="documentwrapper">
|
39
|
-
|
40
|
-
<div class="body">
|
41
|
-
|
42
|
-
<div class="section" id="knife-search">
|
43
|
-
<h1>knife search<a class="headerlink" href="#knife-search" title="Permalink to this headline">¶</a></h1>
|
44
|
-
<p>Search indexes allow queries to be made for any type of data that is indexed by the Chef server, including data bags (and data bag items), environments, nodes, and roles. A defined query syntax is used to support search patterns like exact, wildcard, range, and fuzzy. A search is a full-text query that can be done from several locations, including from within a recipe, by using the <tt class="docutils literal"><span class="pre">search</span></tt> subcommand in knife, the <tt class="docutils literal"><span class="pre">search</span></tt> method in the Recipe DSL, and by using the <tt class="docutils literal"><span class="pre">/search</span></tt> or <tt class="docutils literal"><span class="pre">/search/INDEX</span></tt> endpoints in the Chef server API. The search engine is based on Apache Solr and is run from the Chef server.</p>
|
45
|
-
<p>The <strong>knife search</strong> subcommand is used run a search query for information that is indexed on a Chef server.</p>
|
46
|
-
<div class="section" id="syntax">
|
47
|
-
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
|
48
|
-
<p>This subcommand has the following syntax:</p>
|
49
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search INDEX SEARCH_QUERY
|
50
|
-
</pre></div>
|
51
|
-
</div>
|
52
|
-
<p>where <tt class="docutils literal"><span class="pre">INDEX</span></tt> is one of <tt class="docutils literal"><span class="pre">client</span></tt>, <tt class="docutils literal"><span class="pre">environment</span></tt>, <tt class="docutils literal"><span class="pre">node</span></tt>, <tt class="docutils literal"><span class="pre">role</span></tt>, or the name of a data bag and <tt class="docutils literal"><span class="pre">SEARCH_QUERY</span></tt> is the search query syntax for the query that will be executed.</p>
|
53
|
-
<p><tt class="docutils literal"><span class="pre">INDEX</span></tt> is implied if omitted, and will default to <tt class="docutils literal"><span class="pre">node</span></tt>. For example:</p>
|
54
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search <span class="s1">'*:*'</span> -i
|
55
|
-
</pre></div>
|
56
|
-
</div>
|
57
|
-
<p>will return something similar to:</p>
|
58
|
-
<div class="highlight-bash"><div class="highlight"><pre>8 items found
|
59
|
-
|
60
|
-
centos-62-dev
|
61
|
-
opensuse-1203
|
62
|
-
ubuntu-1304-dev
|
63
|
-
ubuntu-1304-orgtest
|
64
|
-
ubuntu-1204-ohai-test
|
65
|
-
ubuntu-1304-ifcfg-test
|
66
|
-
ohai-test
|
67
|
-
win2k8-dev
|
68
|
-
</pre></div>
|
69
|
-
</div>
|
70
|
-
<p>and is the same search as:</p>
|
71
|
-
<div class="highlight-bash"><div class="highlight"><pre>$ knife search node '*:*" -i
|
72
|
-
</pre></div>
|
73
|
-
</div>
|
74
|
-
<p>If the <tt class="docutils literal"><span class="pre">SEARCH_QUERY</span></tt> does not contain a colon character (<tt class="docutils literal"><span class="pre">:</span></tt>), then the default query pattern is <tt class="docutils literal"><span class="pre">tags:*#{@query}*</span> <span class="pre">OR</span> <span class="pre">roles:*#{@query}*</span> <span class="pre">OR</span> <span class="pre">fqdn:*#{@query}*</span> <span class="pre">OR</span> <span class="pre">addresses:*#{@query}*</span></tt>, which means the following two search queries are effectively the same:</p>
|
75
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search ubuntu
|
76
|
-
</pre></div>
|
77
|
-
</div>
|
78
|
-
<p>or:</p>
|
79
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s2">"tags:*ubuntu* OR roles:*ubuntu* OR fqdn:*ubuntu* (etc.)"</span>
|
80
|
-
</pre></div>
|
81
|
-
</div>
|
82
|
-
</div>
|
83
|
-
<div class="section" id="options">
|
84
|
-
<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2>
|
85
|
-
<div class="admonition note">
|
86
|
-
<p class="first admonition-title">Note</p>
|
87
|
-
<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) knife subcommands and plugins.</p>
|
88
|
-
</div>
|
89
|
-
<p>This sub-command has the following options:</p>
|
90
|
-
<dl class="docutils">
|
91
|
-
<dt><tt class="docutils literal"><span class="pre">-a</span> <span class="pre">ATTR</span></tt>, <tt class="docutils literal"><span class="pre">--attribute</span> <span class="pre">ATTR</span></tt></dt>
|
92
|
-
<dd>The attribute (or attributes) to show.</dd>
|
93
|
-
<dt><tt class="docutils literal"><span class="pre">-b</span> <span class="pre">ROW</span></tt>, <tt class="docutils literal"><span class="pre">--start</span> <span class="pre">ROW</span></tt></dt>
|
94
|
-
<dd>The row at which return results will begin.</dd>
|
95
|
-
<dt><tt class="docutils literal"><span class="pre">-i</span></tt>, <tt class="docutils literal"><span class="pre">--id-only</span></tt></dt>
|
96
|
-
<dd>Use to show only matching object IDs.</dd>
|
97
|
-
<dt><tt class="docutils literal"><span class="pre">INDEX</span></tt></dt>
|
98
|
-
<dd>The name of the index to be queried: <tt class="docutils literal"><span class="pre">client</span></tt>, <tt class="docutils literal"><span class="pre">environment</span></tt>, <tt class="docutils literal"><span class="pre">node</span></tt>, <tt class="docutils literal"><span class="pre">role</span></tt>, or <tt class="docutils literal"><span class="pre">DATA_BAG_NAME</span></tt>. Default index: <tt class="docutils literal"><span class="pre">node</span></tt>.</dd>
|
99
|
-
<dt><tt class="docutils literal"><span class="pre">-l</span></tt>, <tt class="docutils literal"><span class="pre">--long</span></tt></dt>
|
100
|
-
<dd>Use to display all attributes in the output and to show the output as JSON.</dd>
|
101
|
-
<dt><tt class="docutils literal"><span class="pre">-m</span></tt>, <tt class="docutils literal"><span class="pre">--medium</span></tt></dt>
|
102
|
-
<dd>Use to display normal attributes in the output and to show the output as JSON.</dd>
|
103
|
-
<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">SORT</span></tt>, <tt class="docutils literal"><span class="pre">--sort</span> <span class="pre">SORT</span></tt></dt>
|
104
|
-
<dd>The order in which search results will be sorted.</dd>
|
105
|
-
<dt><tt class="docutils literal"><span class="pre">-q</span> <span class="pre">SEARCH_QUERY</span></tt>, <tt class="docutils literal"><span class="pre">--query</span> <span class="pre">SEARCH_QUERY</span></tt></dt>
|
106
|
-
<dd>Use to protect search queries that start with a hyphen (-). A <tt class="docutils literal"><span class="pre">-q</span></tt> query may be specified as an argument or an option, but not both.</dd>
|
107
|
-
<dt><tt class="docutils literal"><span class="pre">-r</span></tt>, <tt class="docutils literal"><span class="pre">--run-list</span></tt></dt>
|
108
|
-
<dd>Use to show only the run-list.</dd>
|
109
|
-
<dt><tt class="docutils literal"><span class="pre">-R</span> <span class="pre">INT</span></tt>, <tt class="docutils literal"><span class="pre">--rows</span> <span class="pre">INT</span></tt></dt>
|
110
|
-
<dd>The number of rows to be returned.</dd>
|
111
|
-
<dt><tt class="docutils literal"><span class="pre">SEARCH_QUERY</span></tt></dt>
|
112
|
-
<dd>The search query used to identify a a list of items on a Chef server. This option uses the same syntax as the <tt class="docutils literal"><span class="pre">search</span></tt> sub-command.</dd>
|
113
|
-
</dl>
|
114
|
-
</div>
|
115
|
-
<div class="section" id="examples">
|
116
|
-
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
|
117
|
-
<p>The following examples show how to use this knife subcommand:</p>
|
118
|
-
<p><strong>Search by platform ID</strong></p>
|
119
|
-
<p>To search for the IDs of all nodes running on the Amazon EC2 platform, enter:</p>
|
120
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s1">'ec2:*'</span> -i
|
121
|
-
</pre></div>
|
122
|
-
</div>
|
123
|
-
<p>to return something like:</p>
|
124
|
-
<div class="highlight-bash"><div class="highlight"><pre>4 items found
|
125
|
-
|
126
|
-
ip-0A7CA19F.ec2.internal
|
127
|
-
|
128
|
-
ip-0A58CF8E.ec2.internal
|
129
|
-
|
130
|
-
ip-0A58E134.ec2.internal
|
131
|
-
|
132
|
-
ip-0A7CFFD5.ec2.internal
|
133
|
-
</pre></div>
|
134
|
-
</div>
|
135
|
-
<p><strong>Search by instance type</strong></p>
|
136
|
-
<p>To search for the instance type (flavor) of all nodes running on the Amazon EC2 platform, enter:</p>
|
137
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s1">'ec2:*'</span> -a ec2.instance_type
|
138
|
-
</pre></div>
|
139
|
-
</div>
|
140
|
-
<p>to return something like:</p>
|
141
|
-
<div class="highlight-bash"><div class="highlight"><pre>4 items found
|
142
|
-
|
143
|
-
ec2.instance_type: m1.large
|
144
|
-
id: ip-0A7CA19F.ec2.internal
|
145
|
-
|
146
|
-
ec2.instance_type: m1.large
|
147
|
-
id: ip-0A58CF8E.ec2.internal
|
148
|
-
|
149
|
-
ec2.instance_type: m1.large
|
150
|
-
id: ip-0A58E134.ec2.internal
|
151
|
-
|
152
|
-
ec2.instance_type: m1.large
|
153
|
-
id: ip-0A7CFFD5.ec2.internal
|
154
|
-
</pre></div>
|
155
|
-
</div>
|
156
|
-
<p><strong>Search by node</strong></p>
|
157
|
-
<p>To search for all nodes running Ubuntu, enter:</p>
|
158
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s1">'platform:ubuntu'</span>
|
159
|
-
</pre></div>
|
160
|
-
</div>
|
161
|
-
<p><strong>Search by node and environment</strong></p>
|
162
|
-
<p>To search for all nodes running CentOS in the production environment, enter:</p>
|
163
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s1">'chef_environment:production AND platform:centos'</span>
|
164
|
-
</pre></div>
|
165
|
-
</div>
|
166
|
-
<p><strong>Search for nested attributes</strong></p>
|
167
|
-
<p>To find a nested attribute, use a pattern similar to the following:</p>
|
168
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <query_to_run> -a <main_attribute>.<nested_attribute>
|
169
|
-
</pre></div>
|
170
|
-
</div>
|
171
|
-
<p><strong>Search for multiple attributes</strong></p>
|
172
|
-
<p>To build a search query to use more than one attribute, use an underscore (<tt class="docutils literal"><span class="pre">_</span></tt>) to separate each attribute. For example, the following query will search for all nodes running a specific version of Ruby:</p>
|
173
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s2">"languages_ruby_version:1.9.3"</span>
|
174
|
-
</pre></div>
|
175
|
-
</div>
|
176
|
-
<p><strong>Search for nested attributes using a search query</strong></p>
|
177
|
-
<p>To build a search query that can find a nested attribute:</p>
|
178
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node name:<node_name> -a kernel.machine
|
179
|
-
</pre></div>
|
180
|
-
</div>
|
181
|
-
<p><strong>Use a test query</strong></p>
|
182
|
-
<p>To test a search query that will be used in a <strong>knife ssh</strong> command:</p>
|
183
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s2">"role:web NOT name:web03"</span>
|
184
|
-
</pre></div>
|
185
|
-
</div>
|
186
|
-
<p>where the query in the previous example will search all servers that have the <tt class="docutils literal"><span class="pre">web</span></tt> role, but not on the server named <tt class="docutils literal"><span class="pre">web03</span></tt>.</p>
|
187
|
-
</div>
|
188
|
-
</div>
|
189
|
-
|
190
|
-
|
191
|
-
</div>
|
192
|
-
|
193
|
-
</div>
|
194
|
-
|
195
|
-
|
196
|
-
<div class="clearer"></div>
|
197
|
-
</div>
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
</body>
|
203
|
-
</html>
|
@@ -1,79 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
|
4
|
-
|
5
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
6
|
-
<head>
|
7
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
8
|
-
|
9
|
-
<title>knife serve — chef-client Man Pages</title>
|
10
|
-
|
11
|
-
<link rel="stylesheet" href="_static/guide.css" type="text/css" />
|
12
|
-
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
13
|
-
|
14
|
-
<script type="text/javascript">
|
15
|
-
var DOCUMENTATION_OPTIONS = {
|
16
|
-
URL_ROOT: './',
|
17
|
-
VERSION: '',
|
18
|
-
COLLAPSE_INDEX: false,
|
19
|
-
FILE_SUFFIX: '.html',
|
20
|
-
HAS_SOURCE: true
|
21
|
-
};
|
22
|
-
</script>
|
23
|
-
<script type="text/javascript" src="_static/jquery.js"></script>
|
24
|
-
<script type="text/javascript" src="_static/underscore.js"></script>
|
25
|
-
<script type="text/javascript" src="_static/doctools.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px">
|
31
|
-
<a href="http://docs.getchef.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a>
|
32
|
-
</div>
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
<div class="document">
|
38
|
-
<div class="documentwrapper">
|
39
|
-
|
40
|
-
<div class="body">
|
41
|
-
|
42
|
-
<div class="section" id="knife-serve">
|
43
|
-
<h1>knife serve<a class="headerlink" href="#knife-serve" title="Permalink to this headline">¶</a></h1>
|
44
|
-
<p>The <strong>knife serve</strong> subcommand is used to run a persistent chef-zero against the local chef-repo. (chef-zero is a lightweight Chef server that runs in-memory on the local machine.) This is the same as running the chef-client executable with the <tt class="docutils literal"><span class="pre">--local-mode</span></tt> option. The <tt class="docutils literal"><span class="pre">chef_repo_path</span></tt> is located automatically and the Chef server will bind to the first available port between <tt class="docutils literal"><span class="pre">8889</span></tt> and <tt class="docutils literal"><span class="pre">9999</span></tt>. <strong>knife serve</strong> will print the URL for the local Chef server, so that it may be added to the knife.rb file.</p>
|
45
|
-
<div class="section" id="syntax">
|
46
|
-
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
|
47
|
-
<p>This subcommand has the following syntax:</p>
|
48
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife serve <span class="o">(</span>options<span class="o">)</span>
|
49
|
-
</pre></div>
|
50
|
-
</div>
|
51
|
-
</div>
|
52
|
-
<div class="section" id="options">
|
53
|
-
<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2>
|
54
|
-
<div class="admonition note">
|
55
|
-
<p class="first admonition-title">Note</p>
|
56
|
-
<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) knife subcommands and plugins.</p>
|
57
|
-
</div>
|
58
|
-
<p>This command does not have any specific options.</p>
|
59
|
-
</div>
|
60
|
-
<div class="section" id="examples">
|
61
|
-
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
|
62
|
-
<p>None.</p>
|
63
|
-
</div>
|
64
|
-
</div>
|
65
|
-
|
66
|
-
|
67
|
-
</div>
|
68
|
-
|
69
|
-
</div>
|
70
|
-
|
71
|
-
|
72
|
-
<div class="clearer"></div>
|
73
|
-
</div>
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
</body>
|
79
|
-
</html>
|
@@ -1,104 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
|
4
|
-
|
5
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
6
|
-
<head>
|
7
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
8
|
-
|
9
|
-
<title>knife show — chef-client Man Pages</title>
|
10
|
-
|
11
|
-
<link rel="stylesheet" href="_static/guide.css" type="text/css" />
|
12
|
-
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
13
|
-
|
14
|
-
<script type="text/javascript">
|
15
|
-
var DOCUMENTATION_OPTIONS = {
|
16
|
-
URL_ROOT: './',
|
17
|
-
VERSION: '',
|
18
|
-
COLLAPSE_INDEX: false,
|
19
|
-
FILE_SUFFIX: '.html',
|
20
|
-
HAS_SOURCE: true
|
21
|
-
};
|
22
|
-
</script>
|
23
|
-
<script type="text/javascript" src="_static/jquery.js"></script>
|
24
|
-
<script type="text/javascript" src="_static/underscore.js"></script>
|
25
|
-
<script type="text/javascript" src="_static/doctools.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px">
|
31
|
-
<a href="http://docs.getchef.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a>
|
32
|
-
</div>
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
<div class="document">
|
38
|
-
<div class="documentwrapper">
|
39
|
-
|
40
|
-
<div class="body">
|
41
|
-
|
42
|
-
<div class="section" id="knife-show">
|
43
|
-
<h1>knife show<a class="headerlink" href="#knife-show" title="Permalink to this headline">¶</a></h1>
|
44
|
-
<p>The <strong>knife show</strong> subcommand is used to view the details of one (or more) objects on the Chef server. This subcommand works similar to <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">show</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">data</span> <span class="pre">bag</span> <span class="pre">show</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">environment</span> <span class="pre">show</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">show</span></tt>, and <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">role</span> <span class="pre">show</span></tt>, but with a single verb (and a single action).</p>
|
45
|
-
<div class="section" id="syntax">
|
46
|
-
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
|
47
|
-
<p>This subcommand has the following syntax:</p>
|
48
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife show <span class="o">[</span>PATTERN...<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span>
|
49
|
-
</pre></div>
|
50
|
-
</div>
|
51
|
-
</div>
|
52
|
-
<div class="section" id="options">
|
53
|
-
<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2>
|
54
|
-
<div class="admonition note">
|
55
|
-
<p class="first admonition-title">Note</p>
|
56
|
-
<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) knife subcommands and plugins.</p>
|
57
|
-
</div>
|
58
|
-
<p>This subcommand has the following options:</p>
|
59
|
-
<dl class="docutils">
|
60
|
-
<dt><tt class="docutils literal"><span class="pre">-a</span> <span class="pre">ATTR</span></tt>, <tt class="docutils literal"><span class="pre">--attribute</span> <span class="pre">ATTR</span></tt></dt>
|
61
|
-
<dd>The attribute (or attributes) to show.</dd>
|
62
|
-
<dt><tt class="docutils literal"><span class="pre">--chef-repo-path</span> <span class="pre">PATH</span></tt></dt>
|
63
|
-
<dd>The path to the chef-repo. This setting will override the default path to the chef-repo. Default: same value as specified by <tt class="docutils literal"><span class="pre">chef_repo_path</span></tt> in client.rb.</dd>
|
64
|
-
<dt><tt class="docutils literal"><span class="pre">--concurrency</span></tt></dt>
|
65
|
-
<dd>The number of allowed concurrent connections. Default: <tt class="docutils literal"><span class="pre">10</span></tt>.</dd>
|
66
|
-
<dt><tt class="docutils literal"><span class="pre">--local</span></tt></dt>
|
67
|
-
<dd>Use to show local files instead of remote files.</dd>
|
68
|
-
<dt><tt class="docutils literal"><span class="pre">--repo-mode</span> <span class="pre">MODE</span></tt></dt>
|
69
|
-
<dd>The layout of the local chef-repo. Possible values: <tt class="docutils literal"><span class="pre">static</span></tt>, <tt class="docutils literal"><span class="pre">everything</span></tt>, or <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>. Use <tt class="docutils literal"><span class="pre">static</span></tt> for just roles, environments, cookbooks, and data bags. By default, <tt class="docutils literal"><span class="pre">everything</span></tt> and <tt class="docutils literal"><span class="pre">hosted_everything</span></tt> are dynamically selected depending on the server type. Default: <tt class="docutils literal"><span class="pre">everything</span></tt> / <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>.</dd>
|
70
|
-
</dl>
|
71
|
-
</div>
|
72
|
-
<div class="section" id="examples">
|
73
|
-
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
|
74
|
-
<p>The following examples show how to use this knife subcommand:</p>
|
75
|
-
<p><strong>Show all cookbooks</strong></p>
|
76
|
-
<p>To show all cookbooks in the <tt class="docutils literal"><span class="pre">cookbooks/</span></tt> directory:</p>
|
77
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife show cookbooks/
|
78
|
-
</pre></div>
|
79
|
-
</div>
|
80
|
-
<p>or, (if already in the <tt class="docutils literal"><span class="pre">cookbooks/</span></tt> directory in the local chef-repo):</p>
|
81
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife show
|
82
|
-
</pre></div>
|
83
|
-
</div>
|
84
|
-
<p><strong>Show roles and environments</strong></p>
|
85
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife show roles/ environments/
|
86
|
-
</pre></div>
|
87
|
-
</div>
|
88
|
-
</div>
|
89
|
-
</div>
|
90
|
-
|
91
|
-
|
92
|
-
</div>
|
93
|
-
|
94
|
-
</div>
|
95
|
-
|
96
|
-
|
97
|
-
<div class="clearer"></div>
|
98
|
-
</div>
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
</body>
|
104
|
-
</html>
|
@@ -1,177 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
|
4
|
-
|
5
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
6
|
-
<head>
|
7
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
8
|
-
|
9
|
-
<title>knife ssh — chef-client Man Pages</title>
|
10
|
-
|
11
|
-
<link rel="stylesheet" href="_static/guide.css" type="text/css" />
|
12
|
-
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
13
|
-
|
14
|
-
<script type="text/javascript">
|
15
|
-
var DOCUMENTATION_OPTIONS = {
|
16
|
-
URL_ROOT: './',
|
17
|
-
VERSION: '',
|
18
|
-
COLLAPSE_INDEX: false,
|
19
|
-
FILE_SUFFIX: '.html',
|
20
|
-
HAS_SOURCE: true
|
21
|
-
};
|
22
|
-
</script>
|
23
|
-
<script type="text/javascript" src="_static/jquery.js"></script>
|
24
|
-
<script type="text/javascript" src="_static/underscore.js"></script>
|
25
|
-
<script type="text/javascript" src="_static/doctools.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px">
|
31
|
-
<a href="http://docs.getchef.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a>
|
32
|
-
</div>
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
<div class="document">
|
38
|
-
<div class="documentwrapper">
|
39
|
-
|
40
|
-
<div class="body">
|
41
|
-
|
42
|
-
<div class="section" id="knife-ssh">
|
43
|
-
<h1>knife ssh<a class="headerlink" href="#knife-ssh" title="Permalink to this headline">¶</a></h1>
|
44
|
-
<p>The <strong>knife ssh</strong> subcommand is used to invoke SSH commands (in parallel) on a subset of nodes within an organization, based on the results of a <a class="reference external" href="http://docs.opscode.com/essentials_search.html">search query</a> made to the Chef server.</p>
|
45
|
-
<div class="section" id="syntax">
|
46
|
-
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
|
47
|
-
<p>This subcommand has the following syntax:</p>
|
48
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife ssh SEARCH_QUERY SSH_COMMAND <span class="o">(</span>options<span class="o">)</span>
|
49
|
-
</pre></div>
|
50
|
-
</div>
|
51
|
-
</div>
|
52
|
-
<div class="section" id="options">
|
53
|
-
<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2>
|
54
|
-
<div class="admonition note">
|
55
|
-
<p class="first admonition-title">Note</p>
|
56
|
-
<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) knife subcommands and plugins.</p>
|
57
|
-
</div>
|
58
|
-
<p>This subcommand has the following options:</p>
|
59
|
-
<dl class="docutils">
|
60
|
-
<dt><tt class="docutils literal"><span class="pre">-a</span> <span class="pre">SSH_ATTR</span></tt>, <tt class="docutils literal"><span class="pre">--attribute</span> <span class="pre">SSH_ATTR</span></tt></dt>
|
61
|
-
<dd>The attribute that is used when opening the SSH connection. The default attribute is the FQDN of the host. Other possible values include a public IP address, a private IP address, or a hostname.</dd>
|
62
|
-
<dt><tt class="docutils literal"><span class="pre">-A</span></tt>, <tt class="docutils literal"><span class="pre">--forward-agent</span></tt></dt>
|
63
|
-
<dd>Use to enable SSH agent forwarding.</dd>
|
64
|
-
<dt><tt class="docutils literal"><span class="pre">-C</span> <span class="pre">NUM</span></tt>, <tt class="docutils literal"><span class="pre">--concurrency</span> <span class="pre">NUM</span></tt></dt>
|
65
|
-
<dd>The number of allowed concurrent connections.</dd>
|
66
|
-
<dt><tt class="docutils literal"><span class="pre">-G</span> <span class="pre">GATEWAY</span></tt>, <tt class="docutils literal"><span class="pre">--ssh-gateway</span> <span class="pre">GATEWAY</span></tt></dt>
|
67
|
-
<dd>The SSH tunnel or gateway that is used to run a bootstrap action on a machine that is not accessible from the workstation.</dd>
|
68
|
-
<dt><tt class="docutils literal"><span class="pre">-i</span> <span class="pre">IDENTITY_FILE</span></tt>, <tt class="docutils literal"><span class="pre">--identity-file</span> <span class="pre">IDENTIFY_FILE</span></tt></dt>
|
69
|
-
<dd>The SSH identity file used for authentication. Key-based authentication is recommended.</dd>
|
70
|
-
<dt><tt class="docutils literal"><span class="pre">-m</span></tt>, <tt class="docutils literal"><span class="pre">--manual-list</span></tt></dt>
|
71
|
-
<dd>Use to define a search query as a space-separated list of servers. If there is more than one item in the list, put quotes around the entire list. For example: <tt class="docutils literal"><span class="pre">--manual-list</span> <span class="pre">"server01</span> <span class="pre">server</span> <span class="pre">02</span> <span class="pre">server</span> <span class="pre">03"</span></tt></dd>
|
72
|
-
<dt><tt class="docutils literal"><span class="pre">--[no-]host-key-verify</span></tt></dt>
|
73
|
-
<dd>Use <tt class="docutils literal"><span class="pre">--no-host-key-verify</span></tt> to disable host key verification. Default setting: <tt class="docutils literal"><span class="pre">--host-key-verify</span></tt>.</dd>
|
74
|
-
<dt><tt class="docutils literal"><span class="pre">OTHER</span></tt></dt>
|
75
|
-
<dd>The shell type. Possible values: <tt class="docutils literal"><span class="pre">interactive</span></tt>, <tt class="docutils literal"><span class="pre">screen</span></tt>, <tt class="docutils literal"><span class="pre">tmux</span></tt>, <tt class="docutils literal"><span class="pre">macterm</span></tt>, or <tt class="docutils literal"><span class="pre">cssh</span></tt>. (<tt class="docutils literal"><span class="pre">csshx</span></tt> is deprecated in favor of <tt class="docutils literal"><span class="pre">cssh</span></tt>.)</dd>
|
76
|
-
<dt><tt class="docutils literal"><span class="pre">-p</span> <span class="pre">PORT</span></tt>, <tt class="docutils literal"><span class="pre">--ssh-port</span> <span class="pre">PORT</span></tt></dt>
|
77
|
-
<dd>The SSH port.</dd>
|
78
|
-
<dt><tt class="docutils literal"><span class="pre">-P</span> <span class="pre">PASSWORD</span></tt>, <tt class="docutils literal"><span class="pre">--ssh-password</span> <span class="pre">PASSWORD</span></tt></dt>
|
79
|
-
<dd>The SSH password. This can be used to pass the password directly on the command line. If this option is not specified (and a password is required) knife will prompt for the password.</dd>
|
80
|
-
<dt><tt class="docutils literal"><span class="pre">SEARCH_QUERY</span></tt></dt>
|
81
|
-
<dd>The search query used to return a list of servers to be accessed using SSH and the specified <tt class="docutils literal"><span class="pre">SSH_COMMAND</span></tt>. This option uses the same syntax as the search sub-command.</dd>
|
82
|
-
<dt><tt class="docutils literal"><span class="pre">SSH_COMMAND</span></tt></dt>
|
83
|
-
<dd>The command that will be run against the results of a search query.</dd>
|
84
|
-
<dt><tt class="docutils literal"><span class="pre">-x</span> <span class="pre">USER_NAME</span></tt>, <tt class="docutils literal"><span class="pre">--ssh-user</span> <span class="pre">USER_NAME</span></tt></dt>
|
85
|
-
<dd>The SSH user name.</dd>
|
86
|
-
</dl>
|
87
|
-
</div>
|
88
|
-
<div class="section" id="examples">
|
89
|
-
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
|
90
|
-
<p>The following examples show how to use this knife subcommand:</p>
|
91
|
-
<p><strong>Find server uptime</strong></p>
|
92
|
-
<p>To find the uptime of all of web servers running Ubuntu on the Amazon EC2 platform, enter:</p>
|
93
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife ssh <span class="s2">"role:web"</span> <span class="s2">"uptime"</span> -x ubuntu -a ec2.public_hostname
|
94
|
-
</pre></div>
|
95
|
-
</div>
|
96
|
-
<p>to return something like:</p>
|
97
|
-
<div class="highlight-bash"><div class="highlight"><pre>ec2-174-129-127-206.compute-1.amazonaws.com 13:50:47 up 1 day, 23:26, 1 user, load average: 0.25, 0.18, 0.11
|
98
|
-
ec2-67-202-63-102.compute-1.amazonaws.com 13:50:47 up 1 day, 23:33, 1 user, load average: 0.12, 0.13, 0.10
|
99
|
-
ec2-184-73-9-250.compute-1.amazonaws.com 13:50:48 up 16:45, 1 user, load average: 0.30, 0.22, 0.13
|
100
|
-
ec2-75-101-240-230.compute-1.amazonaws.com 13:50:48 up 1 day, 22:59, 1 user, load average: 0.24, 0.17, 0.11
|
101
|
-
ec2-184-73-60-141.compute-1.amazonaws.com 13:50:48 up 1 day, 23:30, 1 user, load average: 0.32, 0.17, 0.15
|
102
|
-
</pre></div>
|
103
|
-
</div>
|
104
|
-
<p><strong>Run the chef-client on all nodes</strong></p>
|
105
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife ssh <span class="s1">'name:*'</span> <span class="s1">'sudo chef-client'</span>
|
106
|
-
</pre></div>
|
107
|
-
</div>
|
108
|
-
<p><strong>Force a chef-client run</strong></p>
|
109
|
-
<p>To force a chef-client run on all of the web servers running Ubuntu on the Amazon EC2 platform, enter:</p>
|
110
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife ssh <span class="s2">"role:web"</span> <span class="s2">"sudo chef-client"</span> -x ubuntu -a ec2.public_hostname
|
111
|
-
</pre></div>
|
112
|
-
</div>
|
113
|
-
<p>to return something like:</p>
|
114
|
-
<div class="highlight-bash"><div class="highlight"><pre>ec2-67-202-63-102.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:37 +0000<span class="o">]</span> INFO: Starting Chef Run <span class="o">(</span>Version 0.9.10<span class="o">)</span>
|
115
|
-
ec2-174-129-127-206.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:37 +0000<span class="o">]</span> INFO: Starting Chef Run <span class="o">(</span>Version 0.9.10<span class="o">)</span>
|
116
|
-
ec2-184-73-9-250.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:38 +0000<span class="o">]</span> INFO: Starting Chef Run <span class="o">(</span>Version 0.9.10<span class="o">)</span>
|
117
|
-
ec2-75-101-240-230.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:38 +0000<span class="o">]</span> INFO: Starting Chef Run <span class="o">(</span>Version 0.9.10<span class="o">)</span>
|
118
|
-
ec2-184-73-60-141.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:38 +0000<span class="o">]</span> INFO: Starting Chef Run <span class="o">(</span>Version 0.9.10<span class="o">)</span>
|
119
|
-
ec2-174-129-127-206.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:39 +0000<span class="o">]</span> INFO: Chef Run <span class="nb">complete </span>in 1.419243 seconds
|
120
|
-
ec2-174-129-127-206.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:39 +0000<span class="o">]</span> INFO: cleaning the checksum cache
|
121
|
-
ec2-174-129-127-206.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:39 +0000<span class="o">]</span> INFO: Running report handlers
|
122
|
-
ec2-174-129-127-206.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:39 +0000<span class="o">]</span> INFO: Report handlers <span class="nb">complete</span>
|
123
|
-
ec2-67-202-63-102.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:39 +0000<span class="o">]</span> INFO: Chef Run <span class="nb">complete </span>in 1.578265 seconds
|
124
|
-
ec2-67-202-63-102.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:39 +0000<span class="o">]</span> INFO: cleaning the checksum cache
|
125
|
-
ec2-67-202-63-102.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:39 +0000<span class="o">]</span> INFO: Running report handlers
|
126
|
-
ec2-67-202-63-102.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:39 +0000<span class="o">]</span> INFO: Report handlers <span class="nb">complete</span>
|
127
|
-
ec2-184-73-9-250.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Chef Run <span class="nb">complete </span>in 1.638884 seconds
|
128
|
-
ec2-184-73-9-250.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: cleaning the checksum cache
|
129
|
-
ec2-184-73-9-250.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Running report handlers
|
130
|
-
ec2-184-73-9-250.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Report handlers <span class="nb">complete</span>
|
131
|
-
ec2-75-101-240-230.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Chef Run <span class="nb">complete </span>in 1.540257 seconds
|
132
|
-
ec2-75-101-240-230.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: cleaning the checksum cache
|
133
|
-
ec2-75-101-240-230.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Running report handlers
|
134
|
-
ec2-75-101-240-230.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Report handlers <span class="nb">complete</span>
|
135
|
-
ec2-184-73-60-141.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Chef Run <span class="nb">complete </span>in 1.502489 seconds
|
136
|
-
ec2-184-73-60-141.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: cleaning the checksum cache
|
137
|
-
ec2-184-73-60-141.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Running report handlers
|
138
|
-
ec2-184-73-60-141.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Report handlers <span class="nb">complete</span>
|
139
|
-
</pre></div>
|
140
|
-
</div>
|
141
|
-
<p><strong>Run a command based on search query</strong></p>
|
142
|
-
<p>To query for all nodes that have the <tt class="docutils literal"><span class="pre">webserver</span></tt> role and then use SSH to run the command <tt class="docutils literal"><span class="pre">sudo</span> <span class="pre">chef-client</span></tt>, enter:</p>
|
143
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife ssh <span class="s2">"role:webserver"</span> <span class="s2">"sudo chef-client"</span>
|
144
|
-
</pre></div>
|
145
|
-
</div>
|
146
|
-
<p><strong>Upgrade all nodes</strong></p>
|
147
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife ssh name:* <span class="s2">"sudo aptitude upgrade -y"</span>
|
148
|
-
</pre></div>
|
149
|
-
</div>
|
150
|
-
<p><strong>Specify the shell type</strong></p>
|
151
|
-
<p>To specify the shell type used on the nodes returned by a search query:</p>
|
152
|
-
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife ssh roles:opscode-omnitruck macterm
|
153
|
-
</pre></div>
|
154
|
-
</div>
|
155
|
-
<p>where <tt class="docutils literal"><span class="pre">screen</span></tt> is one of the following values: <tt class="docutils literal"><span class="pre">cssh</span></tt>, <tt class="docutils literal"><span class="pre">interactive</span></tt>, <tt class="docutils literal"><span class="pre">macterm</span></tt>, <tt class="docutils literal"><span class="pre">screen</span></tt>, or <tt class="docutils literal"><span class="pre">tmux</span></tt>. If the node does not have the shell type installed, knife will return an error similar to the following:</p>
|
156
|
-
<div class="highlight-bash"><div class="highlight"><pre>you need the rb-appscript gem to use knife ssh macterm.
|
157
|
-
<span class="sb">`</span><span class="o">(</span>sudo<span class="o">)</span> gem install rb-appscript<span class="sb">`</span> to install
|
158
|
-
ERROR: LoadError: cannot load such file -- appscript
|
159
|
-
</pre></div>
|
160
|
-
</div>
|
161
|
-
</div>
|
162
|
-
</div>
|
163
|
-
|
164
|
-
|
165
|
-
</div>
|
166
|
-
|
167
|
-
</div>
|
168
|
-
|
169
|
-
|
170
|
-
<div class="clearer"></div>
|
171
|
-
</div>
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
</body>
|
177
|
-
</html>
|