chef 11.12.8 → 11.14.0.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -2
- data/distro/common/html/_sources/index.txt +6 -0
- data/distro/common/html/_sources/knife_ssl_check.txt +41 -0
- data/distro/common/html/_sources/knife_ssl_fetch.txt +41 -0
- data/distro/common/html/_static/basic.css +2 -5
- data/distro/common/html/_static/doctools.js +5 -14
- data/distro/common/html/_static/jquery.js +2 -154
- data/distro/common/html/_static/pygments.css +2 -2
- data/distro/common/html/_static/searchtools.js +212 -150
- data/distro/common/html/_static/underscore.js +29 -21
- data/distro/common/html/_static/websupport.js +1 -1
- data/distro/common/html/ctl_chef_client.html +15 -18
- data/distro/common/html/ctl_chef_server.html +7 -7
- data/distro/common/html/ctl_chef_shell.html +6 -6
- data/distro/common/html/ctl_chef_solo.html +7 -8
- data/distro/common/html/index.html +34 -24
- data/distro/common/html/knife.html +23 -24
- data/distro/common/html/knife_bootstrap.html +13 -9
- data/distro/common/html/knife_client.html +10 -11
- data/distro/common/html/knife_common_options.html +6 -7
- data/distro/common/html/knife_configure.html +3 -4
- data/distro/common/html/knife_cookbook.html +18 -11
- data/distro/common/html/knife_cookbook_site.html +14 -14
- data/distro/common/html/knife_data_bag.html +24 -23
- data/distro/common/html/knife_delete.html +4 -5
- data/distro/common/html/knife_deps.html +4 -5
- data/distro/common/html/knife_diff.html +6 -7
- data/distro/common/html/knife_download.html +12 -13
- data/distro/common/html/knife_edit.html +4 -5
- data/distro/common/html/knife_environment.html +8 -9
- data/distro/common/html/knife_exec.html +9 -10
- data/distro/common/html/knife_index_rebuild.html +4 -5
- data/distro/common/html/knife_list.html +8 -9
- data/distro/common/html/knife_node.html +34 -33
- data/distro/common/html/knife_raw.html +2 -3
- data/distro/common/html/knife_recipe_list.html +3 -4
- data/distro/common/html/knife_role.html +30 -29
- data/distro/common/html/knife_search.html +7 -7
- data/distro/common/html/knife_show.html +4 -5
- data/distro/common/html/knife_ssh.html +2 -3
- data/distro/common/html/knife_ssl_check.html +148 -0
- data/distro/common/html/knife_ssl_fetch.html +152 -0
- data/distro/common/html/knife_status.html +4 -5
- data/distro/common/html/knife_tag.html +2 -3
- data/distro/common/html/knife_upload.html +5 -6
- data/distro/common/html/knife_user.html +9 -10
- data/distro/common/html/knife_using.html +12 -12
- data/distro/common/html/knife_xargs.html +11 -12
- data/distro/common/html/search.html +1 -2
- data/distro/common/html/searchindex.js +1 -1
- data/distro/common/man/man1/chef-shell.1 +19 -11
- data/distro/common/man/man1/knife-bootstrap.1 +35 -19
- data/distro/common/man/man1/knife-client.1 +111 -28
- data/distro/common/man/man1/knife-configure.1 +30 -14
- data/distro/common/man/man1/knife-cookbook-site.1 +105 -22
- data/distro/common/man/man1/knife-cookbook.1 +164 -23
- data/distro/common/man/man1/knife-data-bag.1 +157 -33
- data/distro/common/man/man1/knife-delete.1 +21 -17
- data/distro/common/man/man1/knife-deps.1 +60 -16
- data/distro/common/man/man1/knife-diff.1 +37 -17
- data/distro/common/man/man1/knife-download.1 +68 -24
- data/distro/common/man/man1/knife-edit.1 +19 -15
- data/distro/common/man/man1/knife-environment.1 +105 -17
- data/distro/common/man/man1/knife-exec.1 +78 -18
- data/distro/common/man/man1/knife-index-rebuild.1 +16 -8
- data/distro/common/man/man1/knife-list.1 +39 -23
- data/distro/common/man/man1/knife-node.1 +170 -22
- data/distro/common/man/man1/knife-raw.1 +33 -13
- data/distro/common/man/man1/knife-recipe-list.1 +17 -5
- data/distro/common/man/man1/knife-role.1 +86 -18
- data/distro/common/man/man1/knife-search.1 +80 -16
- data/distro/common/man/man1/knife-show.1 +30 -14
- data/distro/common/man/man1/knife-ssh.1 +54 -14
- data/distro/common/man/man1/knife-ssl-check.1 +207 -0
- data/distro/common/man/man1/knife-ssl-fetch.1 +207 -0
- data/distro/common/man/man1/knife-status.1 +48 -12
- data/distro/common/man/man1/knife-tag.1 +30 -10
- data/distro/common/man/man1/knife-upload.1 +72 -20
- data/distro/common/man/man1/knife-user.1 +79 -23
- data/distro/common/man/man1/knife-xargs.1 +61 -53
- data/distro/common/man/man8/chef-client.8 +87 -29
- data/distro/common/man/man8/chef-solo.8 +36 -15
- data/lib/chef/application.rb +19 -14
- data/lib/chef/application/client.rb +5 -0
- data/lib/chef/application/solo.rb +5 -0
- data/lib/chef/application/windows_service_manager.rb +3 -0
- data/lib/chef/chef_fs/chef_fs_data_store.rb +72 -24
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_cookbook_dir.rb +20 -4
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_cookbooks_dir.rb +20 -1
- data/lib/chef/chef_fs/file_system/file_system_entry.rb +10 -2
- data/lib/chef/client.rb +2 -3
- data/lib/chef/config.rb +34 -8
- data/lib/chef/cookbook/cookbook_version_loader.rb +45 -4
- data/lib/chef/cookbook_version.rb +38 -30
- data/lib/chef/dsl/recipe.rb +4 -1
- data/lib/chef/event_dispatch/base.rb +14 -0
- data/lib/chef/event_dispatch/events_output_stream.rb +29 -0
- data/lib/chef/exceptions.rb +8 -0
- data/lib/chef/formatters/base.rb +16 -45
- data/lib/chef/formatters/doc.rb +51 -26
- data/lib/chef/formatters/indentable_output_stream.rb +165 -0
- data/lib/chef/knife/node_environment_set.rb +54 -0
- data/lib/chef/knife/user_create.rb +1 -1
- data/lib/chef/monkey_patches/pathname.rb +32 -0
- data/lib/chef/node.rb +1 -1
- data/lib/chef/platform/provider_mapping.rb +345 -338
- data/lib/chef/policy_builder/expand_node_object.rb +1 -1
- data/lib/chef/policy_builder/policyfile.rb +1 -1
- data/lib/chef/provider.rb +1 -0
- data/lib/chef/provider/git.rb +1 -1
- data/lib/chef/provider/link.rb +2 -2
- data/lib/chef/provider/remote_file/content.rb +1 -1
- data/lib/chef/provider/remote_file/local_file.rb +8 -2
- data/lib/chef/provider/service/arch.rb +0 -1
- data/lib/chef/provider/service/debian.rb +0 -2
- data/lib/chef/provider/service/freebsd.rb +2 -1
- data/lib/chef/provider/service/gentoo.rb +1 -1
- data/lib/chef/provider/service/init.rb +0 -1
- data/lib/chef/provider/service/insserv.rb +0 -2
- data/lib/chef/provider/service/invokercd.rb +0 -2
- data/lib/chef/provider/service/macosx.rb +2 -1
- data/lib/chef/provider/service/redhat.rb +0 -1
- data/lib/chef/provider/service/simple.rb +1 -0
- data/lib/chef/provider/service/solaris.rb +1 -0
- data/lib/chef/provider/service/systemd.rb +1 -1
- data/lib/chef/provider/service/upstart.rb +1 -1
- data/lib/chef/provider/user.rb +9 -9
- data/lib/chef/provider/user/solaris.rb +2 -0
- data/lib/chef/resource.rb +1 -0
- data/lib/chef/resource/remote_file.rb +32 -6
- data/lib/chef/run_context.rb +22 -0
- data/lib/chef/run_lock.rb +43 -4
- data/lib/chef/version.rb +2 -2
- data/spec/functional/http/simple_spec.rb +84 -0
- data/spec/functional/resource/remote_file_spec.rb +107 -43
- data/spec/functional/rest_spec.rb +94 -0
- data/spec/functional/run_lock_spec.rb +1 -1
- data/spec/functional/win32/service_manager_spec.rb +6 -0
- data/spec/integration/knife/chef_fs_data_store_spec.rb +2 -0
- data/spec/integration/recipes/lwrp_inline_resources_spec.rb +76 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/support/mock/platform.rb +7 -0
- data/spec/support/pedant/pedant_config.rb +121 -0
- data/spec/support/pedant/run_pedant.rb +63 -0
- data/spec/support/pedant/stickywicket.pem +27 -0
- data/spec/support/shared/functional/http.rb +242 -0
- data/spec/support/shared/unit/api_error_inspector.rb +2 -2
- data/spec/unit/api_client_spec.rb +2 -2
- data/spec/unit/application/client_spec.rb +6 -1
- data/spec/unit/application/knife_spec.rb +4 -0
- data/spec/unit/application/solo_spec.rb +2 -0
- data/spec/unit/application_spec.rb +7 -0
- data/spec/unit/client_spec.rb +16 -0
- data/spec/unit/config_spec.rb +3 -20
- data/spec/unit/cookbook_version_spec.rb +224 -122
- data/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +2 -2
- data/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb +2 -2
- data/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb +2 -2
- data/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +2 -2
- data/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb +2 -2
- data/spec/unit/handler_spec.rb +0 -1
- data/spec/unit/knife/client_bulk_delete_spec.rb +3 -0
- data/spec/unit/knife/cookbook_bulk_delete_spec.rb +2 -0
- data/spec/unit/knife/cookbook_metadata_spec.rb +2 -2
- data/spec/unit/knife/cookbook_site_install_spec.rb +3 -1
- data/spec/unit/knife/cookbook_upload_spec.rb +10 -10
- data/spec/unit/knife/node_environment_set_spec.rb +80 -0
- data/spec/unit/knife/user_create_spec.rb +6 -4
- data/spec/unit/knife/user_edit_spec.rb +5 -0
- data/spec/unit/knife_spec.rb +3 -0
- data/spec/unit/mixin/securable_spec.rb +18 -20
- data/spec/unit/node/attribute_spec.rb +15 -2
- data/spec/unit/node/immutable_collections_spec.rb +4 -4
- data/spec/unit/provider/cron_spec.rb +14 -14
- data/spec/unit/provider/git_spec.rb +4 -4
- data/spec/unit/provider/group_spec.rb +1 -1
- data/spec/unit/provider/ohai_spec.rb +2 -2
- data/spec/unit/provider/remote_file/content_spec.rb +58 -35
- data/spec/unit/provider/remote_file/local_file_spec.rb +23 -0
- data/spec/unit/provider/service/solaris_smf_service_spec.rb +13 -13
- data/spec/unit/resource/mount_spec.rb +0 -1
- data/spec/unit/resource/remote_file_spec.rb +29 -0
- data/spec/unit/resource_spec.rb +1 -1
- data/spec/unit/run_context_spec.rb +7 -0
- data/spec/unit/run_lock_spec.rb +98 -0
- data/spec/unit/version_constraint_spec.rb +1 -1
- metadata +164 -151
- data/distro/common/html/_static/chef.css +0 -507
- data/distro/common/html/_static/chef_logo.png +0 -0
- data/lib/chef/checksum/storage.rb +0 -18
- data/lib/chef/checksum/storage/filesystem.rb +0 -56
- data/spec/unit/checksum/storage/filesystem_spec.rb +0 -70
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
.\" Man page generated from reStructuredText.
|
2
|
+
.
|
3
|
+
.TH "KNIFE-EXEC" "1" "Chef 11.12.0" "" "knife exec"
|
2
4
|
.SH NAME
|
3
5
|
knife-exec \- The man page for the knife exec subcommand.
|
4
6
|
.
|
@@ -28,14 +30,12 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
28
30
|
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
29
31
|
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
|
30
32
|
..
|
31
|
-
.\" Man page generated from reStructuredText.
|
32
|
-
.
|
33
33
|
.sp
|
34
|
-
The \fBknife exec\fP subcommand uses the Knife configuration file to execute Ruby scripts in the context of a fully configured chef\-client
|
34
|
+
The \fBknife exec\fP subcommand uses the Knife configuration file to execute Ruby scripts in the context of a fully configured chef\-client\&. This subcommand is most often used to run scripts that will only access Chef server one time (or otherwise very infrequently). Use this subcommand any time that an operation does not warrant full usage of the Knife subcommand library.
|
35
35
|
.sp
|
36
36
|
\fBAuthenticated API Requests\fP
|
37
37
|
.sp
|
38
|
-
The \fBknife exec\fP subcommand can be used to make authenticated API requests to the server using the following methods:
|
38
|
+
The \fBknife exec\fP subcommand can be used to make authenticated API requests to the Chef server using the following methods:
|
39
39
|
.TS
|
40
40
|
center;
|
41
41
|
|l|l|.
|
@@ -49,36 +49,40 @@ _
|
|
49
49
|
T{
|
50
50
|
\fBapi.delete\fP
|
51
51
|
T} T{
|
52
|
-
Use to delete an object from the server
|
52
|
+
Use to delete an object from the Chef server\&.
|
53
53
|
T}
|
54
54
|
_
|
55
55
|
T{
|
56
56
|
\fBapi.get\fP
|
57
57
|
T} T{
|
58
|
-
Use to get the details of an object on the server
|
58
|
+
Use to get the details of an object on the Chef server\&.
|
59
59
|
T}
|
60
60
|
_
|
61
61
|
T{
|
62
62
|
\fBapi.post\fP
|
63
63
|
T} T{
|
64
|
-
Use to add an object to the server
|
64
|
+
Use to add an object to the Chef server\&.
|
65
65
|
T}
|
66
66
|
_
|
67
67
|
T{
|
68
68
|
\fBapi.put\fP
|
69
69
|
T} T{
|
70
|
-
Use to update an object on the server
|
70
|
+
Use to update an object on the Chef server\&.
|
71
71
|
T}
|
72
72
|
_
|
73
73
|
.TE
|
74
74
|
.sp
|
75
|
-
These methods are used with the \fB\-E\fP option, which executes that string locally on the workstation using chef\-shell
|
75
|
+
These methods are used with the \fB\-E\fP option, which executes that string locally on the workstation using chef\-shell\&. These methods have the following syntax:
|
76
|
+
.INDENT 0.0
|
77
|
+
.INDENT 3.5
|
76
78
|
.sp
|
77
79
|
.nf
|
78
80
|
.ft C
|
79
81
|
$ knife exec \-E \(aqapi.method(/endpoint)\(aq
|
80
82
|
.ft P
|
81
83
|
.fi
|
84
|
+
.UNINDENT
|
85
|
+
.UNINDENT
|
82
86
|
.sp
|
83
87
|
where:
|
84
88
|
.INDENT 0.0
|
@@ -89,24 +93,34 @@ where:
|
|
89
93
|
.UNINDENT
|
90
94
|
.sp
|
91
95
|
For example, to get the data for a node named "Example_Node":
|
96
|
+
.INDENT 0.0
|
97
|
+
.INDENT 3.5
|
92
98
|
.sp
|
93
99
|
.nf
|
94
100
|
.ft C
|
95
101
|
$ knife exec \-E \(aqputs api.get("/nodes/Example_Node")\(aq
|
96
102
|
.ft P
|
97
103
|
.fi
|
104
|
+
.UNINDENT
|
105
|
+
.UNINDENT
|
98
106
|
.sp
|
99
107
|
and to ensure that the output is visible in the console, add the \fBputs\fP in front of the API authorization request:
|
108
|
+
.INDENT 0.0
|
109
|
+
.INDENT 3.5
|
100
110
|
.sp
|
101
111
|
.nf
|
102
112
|
.ft C
|
103
113
|
$ knife exec \-E \(aqputs api.get("/nodes/Example_Node")\(aq
|
104
114
|
.ft P
|
105
115
|
.fi
|
116
|
+
.UNINDENT
|
117
|
+
.UNINDENT
|
106
118
|
.sp
|
107
|
-
where \fBputs\fP is the shorter version of the \fB$stdout.puts\fP predefined variable in Ruby
|
119
|
+
where \fBputs\fP is the shorter version of the \fB$stdout.puts\fP predefined variable in Ruby\&.
|
108
120
|
.sp
|
109
121
|
The following example shows how to add a client named "IBM305RAMAC" and the \fB/clients\fP endpoint, and then return the private key for that user in the console:
|
122
|
+
.INDENT 0.0
|
123
|
+
.INDENT 3.5
|
110
124
|
.sp
|
111
125
|
.nf
|
112
126
|
.ft C
|
@@ -119,16 +133,22 @@ $ client_desc = {
|
|
119
133
|
puts new_client["private_key"]
|
120
134
|
.ft P
|
121
135
|
.fi
|
136
|
+
.UNINDENT
|
137
|
+
.UNINDENT
|
122
138
|
.sp
|
123
139
|
\fBSyntax\fP
|
124
140
|
.sp
|
125
|
-
This
|
141
|
+
This subcommand has the following syntax:
|
142
|
+
.INDENT 0.0
|
143
|
+
.INDENT 3.5
|
126
144
|
.sp
|
127
145
|
.nf
|
128
146
|
.ft C
|
129
147
|
$ knife exec SCRIPT (options)
|
130
148
|
.ft P
|
131
149
|
.fi
|
150
|
+
.UNINDENT
|
151
|
+
.UNINDENT
|
132
152
|
.sp
|
133
153
|
\fBOptions\fP
|
134
154
|
.sp
|
@@ -160,13 +180,13 @@ The $EDITOR that is used for all interactive commands.
|
|
160
180
|
The name of the environment. When this option is added to a command, the command will run only against the named environment.
|
161
181
|
.TP
|
162
182
|
.B \fB\-F FORMAT\fP, \fB\-\-format FORMAT\fP
|
163
|
-
The output format: \fBsummary\fP (default), \fBtext\fP, \fBjson\fP, \fByaml\fP, and \fBpp\fP
|
183
|
+
The output format: \fBsummary\fP (default), \fBtext\fP, \fBjson\fP, \fByaml\fP, and \fBpp\fP\&.
|
164
184
|
.TP
|
165
185
|
.B \fB\-h\fP, \fB\-\-help\fP
|
166
186
|
Shows help for the command.
|
167
187
|
.TP
|
168
188
|
.B \fB\-k KEY\fP, \fB\-\-key KEY\fP
|
169
|
-
The private key that Knife will use to sign requests made by the API client to the server
|
189
|
+
The private key that Knife will use to sign requests made by the API client to the Chef server\&.
|
170
190
|
.TP
|
171
191
|
.B \fB\-p PATH:PATH\fP, \fB\-\-script\-path PATH:PATH\fP
|
172
192
|
A colon\-separated path at which Ruby scripts are located.
|
@@ -175,13 +195,13 @@ A colon\-separated path at which Ruby scripts are located.
|
|
175
195
|
Indicates that data will be shown after a destructive operation.
|
176
196
|
.TP
|
177
197
|
.B \fB\-s URL\fP, \fB\-\-server\-url URL\fP
|
178
|
-
The URL for the server
|
198
|
+
The URL for the Chef server\&.
|
179
199
|
.TP
|
180
200
|
.B \fB\-u USER\fP, \fB\-\-user USER\fP
|
181
|
-
The user name used by Knife to sign requests made by the API client to the server
|
201
|
+
The user name used by Knife to sign requests made by the API client to the Chef server\&. Authentication will fail if the user name does not match the private key.
|
182
202
|
.TP
|
183
203
|
.B \fB\-v\fP, \fB\-\-version\fP
|
184
|
-
The version of the chef\-client
|
204
|
+
The version of the chef\-client\&.
|
185
205
|
.TP
|
186
206
|
.B \fB\-V\fP, \fB\-\-verbose\fP
|
187
207
|
Set for more verbose outputs. Use \fB\-VV\fP for maximum verbosity.
|
@@ -190,28 +210,38 @@ Set for more verbose outputs. Use \fB\-VV\fP for maximum verbosity.
|
|
190
210
|
Indicates that the response to all confirmation prompts will be "Yes" (and that Knife will not ask for confirmation).
|
191
211
|
.TP
|
192
212
|
.B \fB\-z\fP, \fB\-\-local\-mode\fP
|
193
|
-
Indicates that the chef\-client will be run in local mode, which allows all commands that work against the server to also work against the local chef\-repo
|
213
|
+
Indicates that the chef\-client will be run in local mode, which allows all commands that work against the Chef server to also work against the local chef\-repo\&.
|
194
214
|
.UNINDENT
|
195
215
|
.sp
|
196
216
|
\fBExamples\fP
|
197
217
|
.sp
|
198
218
|
There are three ways to use \fBknife exec\fP to run Ruby script files. For example:
|
219
|
+
.INDENT 0.0
|
220
|
+
.INDENT 3.5
|
199
221
|
.sp
|
200
222
|
.nf
|
201
223
|
.ft C
|
202
224
|
$ knife exec /path/to/script_file
|
203
225
|
.ft P
|
204
226
|
.fi
|
227
|
+
.UNINDENT
|
228
|
+
.UNINDENT
|
205
229
|
.sp
|
206
230
|
Or:
|
231
|
+
.INDENT 0.0
|
232
|
+
.INDENT 3.5
|
207
233
|
.sp
|
208
234
|
.nf
|
209
235
|
.ft C
|
210
236
|
$ knife exec \-E \(aqRUBY CODE\(aq
|
211
237
|
.ft P
|
212
238
|
.fi
|
239
|
+
.UNINDENT
|
240
|
+
.UNINDENT
|
213
241
|
.sp
|
214
242
|
Or:
|
243
|
+
.INDENT 0.0
|
244
|
+
.INDENT 3.5
|
215
245
|
.sp
|
216
246
|
.nf
|
217
247
|
.ft C
|
@@ -220,8 +250,12 @@ RUBY CODE
|
|
220
250
|
^D
|
221
251
|
.ft P
|
222
252
|
.fi
|
253
|
+
.UNINDENT
|
254
|
+
.UNINDENT
|
223
255
|
.sp
|
224
256
|
To check the status of Knife using a Ruby script named "status.rb" (which looks like):
|
257
|
+
.INDENT 0.0
|
258
|
+
.INDENT 3.5
|
225
259
|
.sp
|
226
260
|
.nf
|
227
261
|
.ft C
|
@@ -234,32 +268,48 @@ nodes.all do |n|
|
|
234
268
|
end
|
235
269
|
.ft P
|
236
270
|
.fi
|
271
|
+
.UNINDENT
|
272
|
+
.UNINDENT
|
237
273
|
.sp
|
238
274
|
and is located in a directory named "scripts", enter:
|
275
|
+
.INDENT 0.0
|
276
|
+
.INDENT 3.5
|
239
277
|
.sp
|
240
278
|
.nf
|
241
279
|
.ft C
|
242
280
|
$ knife exec scripts/status.rb
|
243
281
|
.ft P
|
244
282
|
.fi
|
283
|
+
.UNINDENT
|
284
|
+
.UNINDENT
|
245
285
|
.sp
|
246
286
|
To show the available free memory for all nodes, enter:
|
287
|
+
.INDENT 0.0
|
288
|
+
.INDENT 3.5
|
247
289
|
.sp
|
248
290
|
.nf
|
249
291
|
.ft C
|
250
292
|
$ knife exec \-E \(aqnodes.all {|n| puts "#{n.name} has #{n.memory.total} free memory"}\(aq
|
251
293
|
.ft P
|
252
294
|
.fi
|
295
|
+
.UNINDENT
|
296
|
+
.UNINDENT
|
253
297
|
.sp
|
254
298
|
To list all of the available search indexes, enter:
|
299
|
+
.INDENT 0.0
|
300
|
+
.INDENT 3.5
|
255
301
|
.sp
|
256
302
|
.nf
|
257
303
|
.ft C
|
258
304
|
$ knife exec \-E \(aqputs api.get("search").keys\(aq
|
259
305
|
.ft P
|
260
306
|
.fi
|
307
|
+
.UNINDENT
|
308
|
+
.UNINDENT
|
261
309
|
.sp
|
262
310
|
To query a node for multiple attributes using a Ruby script named \fBsearch_attributes.rb\fP (which looks like):
|
311
|
+
.INDENT 0.0
|
312
|
+
.INDENT 3.5
|
263
313
|
.sp
|
264
314
|
.nf
|
265
315
|
.ft C
|
@@ -278,16 +328,24 @@ puts results
|
|
278
328
|
exit 0
|
279
329
|
.ft P
|
280
330
|
.fi
|
331
|
+
.UNINDENT
|
332
|
+
.UNINDENT
|
281
333
|
.sp
|
282
334
|
enter:
|
335
|
+
.INDENT 0.0
|
336
|
+
.INDENT 3.5
|
283
337
|
.sp
|
284
338
|
.nf
|
285
339
|
.ft C
|
286
340
|
% knife exec scripts/search_attributes.rb "hostname:test_system" ipaddress,fqdn
|
287
341
|
.ft P
|
288
342
|
.fi
|
343
|
+
.UNINDENT
|
344
|
+
.UNINDENT
|
289
345
|
.sp
|
290
346
|
to return something like:
|
347
|
+
.INDENT 0.0
|
348
|
+
.INDENT 3.5
|
291
349
|
.sp
|
292
350
|
.nf
|
293
351
|
.ft C
|
@@ -296,6 +354,8 @@ Your attributes: ipaddress fqdn
|
|
296
354
|
{"test_system.example.com"=>{"ipaddress"=>"10.1.1.200", "fqdn"=>"test_system.example.com"}}
|
297
355
|
.ft P
|
298
356
|
.fi
|
357
|
+
.UNINDENT
|
358
|
+
.UNINDENT
|
299
359
|
.SH AUTHOR
|
300
360
|
Chef
|
301
361
|
.\" Generated by docutils manpage writer.
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
.\" Man page generated from reStructuredText.
|
2
|
+
.
|
3
|
+
.TH "KNIFE-INDEX-REBUILD" "1" "Chef 11.12.0" "" "knife index rebuild"
|
2
4
|
.SH NAME
|
3
5
|
knife-index-rebuild \- The man page for the knife index rebuild subcommand.
|
4
6
|
.
|
@@ -28,23 +30,29 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
28
30
|
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
29
31
|
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
|
30
32
|
..
|
31
|
-
.\" Man page generated from reStructuredText.
|
32
|
-
.
|
33
33
|
.sp
|
34
|
-
The \fBknife index rebuild\fP subcommand is used to rebuild the search indexes for the open source server
|
35
|
-
.
|
36
|
-
|
37
|
-
.
|
34
|
+
The \fBknife index rebuild\fP subcommand is used to rebuild the search indexes for the open source Chef server\&. This operation is destructive and may take some time.
|
35
|
+
.sp
|
36
|
+
\fBNOTE:\fP
|
37
|
+
.INDENT 0.0
|
38
|
+
.INDENT 3.5
|
39
|
+
This subcommand ONLY works when run against the open source Chef server version 10.x. This subcommand will NOT run against open source Chef server 11, Enterprise Chef (including hosted Enterprise Chef), or Private Chef\&.
|
40
|
+
.UNINDENT
|
41
|
+
.UNINDENT
|
38
42
|
.sp
|
39
43
|
\fBSyntax\fP
|
40
44
|
.sp
|
41
|
-
This
|
45
|
+
This subcommand has the following syntax:
|
46
|
+
.INDENT 0.0
|
47
|
+
.INDENT 3.5
|
42
48
|
.sp
|
43
49
|
.nf
|
44
50
|
.ft C
|
45
51
|
$ knife index rebuild
|
46
52
|
.ft P
|
47
53
|
.fi
|
54
|
+
.UNINDENT
|
55
|
+
.UNINDENT
|
48
56
|
.sp
|
49
57
|
\fBOptions\fP
|
50
58
|
.sp
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
.\" Man page generated from reStructuredText.
|
2
|
+
.
|
3
|
+
.TH "KNIFE-LIST" "1" "Chef 11.12.0" "" "knife list"
|
2
4
|
.SH NAME
|
3
5
|
knife-list \- The man page for the knife list subcommand.
|
4
6
|
.
|
@@ -28,20 +30,22 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
28
30
|
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
29
31
|
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
|
30
32
|
..
|
31
|
-
.\" Man page generated from reStructuredText.
|
32
|
-
.
|
33
33
|
.sp
|
34
|
-
The \fBknife list\fP subcommand is used to view a list of objects on the server
|
34
|
+
The \fBknife list\fP subcommand is used to view a list of objects on the Chef server\&. This subcommand works similar to \fBknife cookbook list\fP, \fBknife data bag list\fP, \fBknife environment list\fP, \fBknife node list\fP, and \fBknife role list\fP, but with a single verb (and a single action).
|
35
35
|
.sp
|
36
36
|
\fBSyntax\fP
|
37
37
|
.sp
|
38
|
-
This
|
38
|
+
This subcommand has the following syntax:
|
39
|
+
.INDENT 0.0
|
40
|
+
.INDENT 3.5
|
39
41
|
.sp
|
40
42
|
.nf
|
41
43
|
.ft C
|
42
44
|
$ knife list [PATTERN...] (options)
|
43
45
|
.ft P
|
44
46
|
.fi
|
47
|
+
.UNINDENT
|
48
|
+
.UNINDENT
|
45
49
|
.sp
|
46
50
|
\fBOptions\fP
|
47
51
|
.sp
|
@@ -49,13 +53,13 @@ This subcommand has the following options:
|
|
49
53
|
.INDENT 0.0
|
50
54
|
.TP
|
51
55
|
.B \fB\-1\fP
|
52
|
-
Indicates that only one column of results will be shown. Default: \fBfalse\fP
|
56
|
+
Indicates that only one column of results will be shown. Default: \fBfalse\fP\&.
|
53
57
|
.TP
|
54
58
|
.B \fB\-c CONFIG_FILE\fP, \fB\-\-config CONFIG_FILE\fP
|
55
59
|
The configuration file to use.
|
56
60
|
.TP
|
57
61
|
.B \fB\-\-chef\-repo\-path PATH\fP
|
58
|
-
The path to the chef\-repo
|
62
|
+
The path to the chef\-repo\&. This setting will override the default path to the chef\-repo\&. Default: same as specified by \fBchef_repo_path\fP in config.rb.
|
59
63
|
.TP
|
60
64
|
.B \fB\-\-chef\-zero\-port PORT\fP
|
61
65
|
The port on which chef\-zero will listen.
|
@@ -64,10 +68,10 @@ The port on which chef\-zero will listen.
|
|
64
68
|
Indicates whether colored output will be used.
|
65
69
|
.TP
|
66
70
|
.B \fB\-\-concurrency\fP
|
67
|
-
The number of allowed concurrent connections. Default: \fB10\fP
|
71
|
+
The number of allowed concurrent connections. Default: \fB10\fP\&.
|
68
72
|
.TP
|
69
73
|
.B \fB\-d\fP
|
70
|
-
Indicates that a directory\(aqs children will not be shown when a directory matches a pattern. Default value: \fBfalse\fP
|
74
|
+
Indicates that a directory\(aqs children will not be shown when a directory matches a pattern. Default value: \fBfalse\fP\&.
|
71
75
|
.TP
|
72
76
|
.B \fB\-\-defaults\fP
|
73
77
|
Indicates that Knife will use the default value, instead of asking a user to provide one.
|
@@ -82,40 +86,40 @@ The $EDITOR that is used for all interactive commands.
|
|
82
86
|
The name of the environment. When this option is added to a command, the command will run only against the named environment.
|
83
87
|
.TP
|
84
88
|
.B \fB\-f\fP, \fB\-\-flat\fP
|
85
|
-
|
89
|
+
Use to show a list of file names. Set to \fBfalse\fP to view ls\-like output. Default: \fBfalse\fP\&.
|
86
90
|
.TP
|
87
91
|
.B \fB\-F FORMAT\fP, \fB\-\-format FORMAT\fP
|
88
|
-
The output format: \fBsummary\fP (default), \fBtext\fP, \fBjson\fP, \fByaml\fP, and \fBpp\fP
|
92
|
+
The output format: \fBsummary\fP (default), \fBtext\fP, \fBjson\fP, \fByaml\fP, and \fBpp\fP\&.
|
89
93
|
.TP
|
90
94
|
.B \fB\-h\fP, \fB\-\-help\fP
|
91
95
|
Shows help for the command.
|
92
96
|
.TP
|
93
97
|
.B \fB\-k KEY\fP, \fB\-\-key KEY\fP
|
94
|
-
The private key that Knife will use to sign requests made by the API client to the server
|
98
|
+
The private key that Knife will use to sign requests made by the API client to the Chef server\&.
|
95
99
|
.TP
|
96
100
|
.B \fB\-\-local\fP
|
97
|
-
Indicates that only contents of the local directory will be returned. Default: \fBfalse\fP
|
101
|
+
Indicates that only contents of the local directory will be returned. Default: \fBfalse\fP\&.
|
98
102
|
.TP
|
99
103
|
.B \fB\-p\fP
|
100
|
-
Indicates that trailing slashes (/) will be shown for directories. Default: \fBfalse\fP
|
104
|
+
Indicates that trailing slashes (/) will be shown for directories. Default: \fBfalse\fP\&.
|
101
105
|
.TP
|
102
106
|
.B \fB\-\-print\-after\fP
|
103
107
|
Indicates that data will be shown after a destructive operation.
|
104
108
|
.TP
|
105
109
|
.B \fB\-R\fP
|
106
|
-
Indicates that directories will be listed recursively. Default: \fBfalse\fP
|
110
|
+
Indicates that directories will be listed recursively. Default: \fBfalse\fP\&.
|
107
111
|
.TP
|
108
112
|
.B \fB\-\-repo\-mode MODE\fP
|
109
|
-
The layout of the local chef\-repo
|
113
|
+
The layout of the local chef\-repo\&. Possible values: \fBstatic\fP, \fBeverything\fP, or \fBhosted_everything\fP\&. Use \fBstatic\fP for just roles, environments, cookbooks, and data bags. By default, \fBeverything\fP and \fBhosted_everything\fP are dynamically selected depending on the server type. Default: \fBeverything\fP / \fBhosted_everything\fP\&.
|
110
114
|
.TP
|
111
115
|
.B \fB\-s URL\fP, \fB\-\-server\-url URL\fP
|
112
|
-
The URL for the server
|
116
|
+
The URL for the Chef server\&.
|
113
117
|
.TP
|
114
118
|
.B \fB\-u USER\fP, \fB\-\-user USER\fP
|
115
|
-
The user name used by Knife to sign requests made by the API client to the server
|
119
|
+
The user name used by Knife to sign requests made by the API client to the Chef server\&. Authentication will fail if the user name does not match the private key.
|
116
120
|
.TP
|
117
121
|
.B \fB\-v\fP, \fB\-\-version\fP
|
118
|
-
The version of the chef\-client
|
122
|
+
The version of the chef\-client\&.
|
119
123
|
.TP
|
120
124
|
.B \fB\-V\fP, \fB\-\-verbose\fP
|
121
125
|
Set for more verbose outputs. Use \fB\-VV\fP for maximum verbosity.
|
@@ -124,34 +128,46 @@ Set for more verbose outputs. Use \fB\-VV\fP for maximum verbosity.
|
|
124
128
|
Indicates that the response to all confirmation prompts will be "Yes" (and that Knife will not ask for confirmation).
|
125
129
|
.TP
|
126
130
|
.B \fB\-z\fP, \fB\-\-local\-mode\fP
|
127
|
-
Indicates that the chef\-client will be run in local mode, which allows all commands that work against the server to also work against the local chef\-repo
|
131
|
+
Indicates that the chef\-client will be run in local mode, which allows all commands that work against the Chef server to also work against the local chef\-repo\&.
|
128
132
|
.UNINDENT
|
129
133
|
.sp
|
130
134
|
\fBExamples\fP
|
131
135
|
.sp
|
132
|
-
For example, to view a list of roles on the server:
|
136
|
+
For example, to view a list of roles on the Chef server:
|
137
|
+
.INDENT 0.0
|
138
|
+
.INDENT 3.5
|
133
139
|
.sp
|
134
140
|
.nf
|
135
141
|
.ft C
|
136
142
|
$ knife list roles/
|
137
143
|
.ft P
|
138
144
|
.fi
|
145
|
+
.UNINDENT
|
146
|
+
.UNINDENT
|
139
147
|
.sp
|
140
|
-
To view a list of roles and environments on the server:
|
148
|
+
To view a list of roles and environments on the Chef server:
|
149
|
+
.INDENT 0.0
|
150
|
+
.INDENT 3.5
|
141
151
|
.sp
|
142
152
|
.nf
|
143
153
|
.ft C
|
144
154
|
$ knife list roles/ environments/
|
145
155
|
.ft P
|
146
156
|
.fi
|
157
|
+
.UNINDENT
|
158
|
+
.UNINDENT
|
147
159
|
.sp
|
148
|
-
To view a list of absolutely everything on the server:
|
160
|
+
To view a list of absolutely everything on the Chef server:
|
161
|
+
.INDENT 0.0
|
162
|
+
.INDENT 3.5
|
149
163
|
.sp
|
150
164
|
.nf
|
151
165
|
.ft C
|
152
166
|
$ knife list \-R /
|
153
167
|
.ft P
|
154
168
|
.fi
|
169
|
+
.UNINDENT
|
170
|
+
.UNINDENT
|
155
171
|
.SH AUTHOR
|
156
172
|
Chef
|
157
173
|
.\" Generated by docutils manpage writer.
|