summaryrefslogtreecommitdiff
path: root/distro/common/man/man1/knife-bootstrap.1
blob: d371906534e88e8508c86c8842bce0798b9ad8a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "KNIFE\-BOOTSTRAP" "1" "January 2013" "Chef 11.0.0.alpha" "Chef Manual"
.
.SH "NAME"
\fBknife\-bootstrap\fR \- Install Chef Client on a remote host
.
.SH "SYNOPSIS"
\fBknife\fR \fBbootstrap\fR \fI(options)\fR
.
.TP
\fB\-i\fR, \fB\-\-identity\-file IDENTITY_FILE\fR
The SSH identity file used for authentication
.
.TP
\fB\-N\fR, \fB\-\-node\-name NAME\fR
The Chef node name for your new node
.
.TP
\fB\-P\fR, \fB\-\-ssh\-password PASSWORD\fR
The ssh password
.
.TP
\fB\-x\fR, \fB\-\-ssh\-user USERNAME\fR
The ssh username
.
.TP
\fB\-p\fR, \fB\-\-ssh\-port PORT\fR
The ssh port
.
.TP
\fB\-\-bootstrap\-version VERSION\fR
The version of Chef to install
.
.TP
\fB\-\-bootstrap\-proxy PROXY_URL\fR
\fBThe proxy server for the node being bootstrapped\fR
.
.TP
\fB\-\-prerelease\fR
Install pre\-release Chef gems
.
.TP
\fB\-r\fR, \fB\-\-run\-list RUN_LIST\fR
Comma separated list of roles/recipes to apply
.
.TP
\fB\-\-template\-file TEMPLATE\fR
Full path to location of template to use
.
.TP
\fB\-\-sudo\fR
Execute the bootstrap via sudo
.
.TP
\fB\-d\fR, \fB\-\-distro DISTRO\fR
Bootstrap a distro using a template
.
.TP
\fB\-\-[no\-]host\-key\-verify\fR
Enable host key verification, which is the default behavior\.
.
.TP
\fB\-\-hint HINT_NAME[=HINT_FILE]\fR
Provide the name of a hint (with option JSON file) to set for use by Ohai plugins\.
.
.SH "DESCRIPTION"
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 plugins\.
.
.P
The bootstrap sub\-command supports supplying a template to perform the bootstrap steps\. If the distro is not specified (via \fB\-d\fR or \fB\-\-distro\fR option), an Ubuntu 10\.04 host bootstrapped with RubyGems is assumed\. The \fBDISTRO\fR value corresponds to the base filename of the template, in other words \fBDISTRO\fR\.erb\. A template file can be specified with the \fB\-\-template\-file\fR option in which case the \fBDISTRO\fR is not used\. The sub\-command looks in the following locations for the template to use:
.
.IP "\(bu" 4
\fBbootstrap\fR directory in the installed Chef Knife library\.
.
.IP "\(bu" 4
\fBbootstrap\fR directory in the \fB$PWD/\.chef\fR\.
.
.IP "\(bu" 4
\fBbootstrap\fR directory in the users \fB$HOME/\.chef\fR\.
.
.IP "" 0
.
.P
The default bootstrap templates are scripts that get copied to the target node (FQDN)\. The following distros are supported:
.
.IP "\(bu" 4
centos5\-gems
.
.IP "\(bu" 4
fedora13\-gems
.
.IP "\(bu" 4
ubuntu10\.04\-gems
.
.IP "\(bu" 4
ubuntu10\.04\-apt
.
.IP "" 0
.
.P
The gems installations will use RubyGems 1\.3\.6 and Chef installed as a gem\. The apt installation will use the Opscode APT repository\.
.
.P
In addition to handling the software installation, these bootstrap templates do the following:
.
.IP "\(bu" 4
Write the validation\.pem per the local knife configuration\.
.
.IP "\(bu" 4
Write a default config file for Chef (\fB/etc/chef/client\.rb\fR) using values from the \fBknife\.rb\fR\.
.
.IP "\(bu" 4
Create a JSON attributes file containing the specified run list and run Chef\.
.
.IP "" 0
.
.P
In the case of the RubyGems, the \fBclient\.rb\fR will be written from scratch with a minimal set of values; see \fBEXAMPLES\fR\. In the case of APT Package installation, \fBclient\.rb\fR will have the \fBvalidation_client_name\fR appended if it is not set to \fBchef\-validator\fR (default config value), and the \fBnode_name\fR will be added if \fBchef_node_name\fR option is specified\.
.
.P
When this is complete, the bootstrapped node will have:
.
.IP "\(bu" 4
Latest Chef version installed from RubyGems or APT Packages from Opscode\. This may be a later version than the local system\.
.
.IP "\(bu" 4
Be validated with the configured Chef Server\.
.
.IP "\(bu" 4
Have run Chef with its default run list if one is specfied\.
.
.IP "" 0
.
.P
Additional custom bootstrap templates can be created and stored in \fB\.chef/bootstrap/DISTRO\.erb\fR, replacing \fBDISTRO\fR with the value passed with the \fB\-d\fR or \fB\-\-distro\fR option\. See \fBEXAMPLES\fR for more information\.
.
.SH "EXAMPLES"
Setting up a custom bootstrap is fairly straightforward\. Create a \fB\.chef/bootstrap\fR directory in your Chef Repository or in \fB$HOME/\.chef/bootstrap\fR\. Then create the ERB template file\.
.
.IP "" 4
.
.nf

mkdir ~/\.chef/bootstrap
vi ~/\.chef/bootstrap/debian5\.0\-apt\.erb
.
.fi
.
.IP "" 0
.
.P
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:
.
.IP "" 4
.
.nf

knife bootstrap mynode\.example\.com \-\-template\-file ~/\.chef/bootstrap/debian5\.0\-apt\.erb
.
.fi
.
.IP "" 0
.
.P
Or,
.
.IP "" 4
.
.nf

knife bootstrap mynode\.example\.com \-\-distro debian5\.0\-apt
.
.fi
.
.IP "" 0
.
.P
The \fB\-\-distro\fR parameter will automatically look in the \fB~/\.chef/bootstrap\fR directory for a file named \fBdebian5\.0\-apt\.erb\fR\.
.
.P
Templates provided by the Chef installation are located in \fBBASEDIR/lib/chef/knife/bootstrap/*\.erb\fR, where \fIBASEDIR\fR is the location where the package or Gem installed the Chef client libraries\.
.
.SH "BUGS"
\fBknife bootstrap\fR is not capable of bootstrapping multiple hosts in parallel\.
.
.P
The bootstrap script is passed as an argument to sh(1) on the remote system, so sensitive information contained in the script will be visible to other users via the process list using tools such as ps(1)\.
.
.SH "SEE ALSO"
\fBknife\-ssh\fR(1)
.
.SH "AUTHOR"
Chef was written by Adam Jacob \fIadam@opscode\.com\fR with many contributions from the community\.
.
.SH "DOCUMENTATION"
This manual page was written by Joshua Timberman \fIjoshua@opscode\.com\fR\. Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2\.0 License\.
.
.SH "CHEF"
Knife is distributed with Chef\. \fIhttp://wiki\.opscode\.com/display/chef/Home\fR