NAME¶
knife-bootstrap - The man page for the knife bootstrap subcommand.
A bootstrap is a process that installs the chef-client on a target system so
that it can run as a chef-client and communicate with a server.
The
knife bootstrap subcommand is used run a bootstrap operation that
installs the chef-client on the target system. The bootstrap operation must
specify the IP address or FQDN of the target system.
Syntax
This argument has the following syntax:
$ knife bootstrap FQDN_or_IP_ADDRESS (options)
Options
This subcommand has the following options:
- -A, --forward-agent
- Indicates that SSH agent forwarding is enabled.
- --bootstrap-no-proxy NO_PROXY_URL_or_IP
- A URL or IP address that specifies a location that should not be proxied.
Note: This option is used internally by Chef to help verify bootstrap
operations during testing and should never be used during an actual
bootstrap operation.
- --bootstrap-proxy PROXY_URL
- The proxy server for the node that is the target of a bootstrap
operation.
- --bootstrap-version VERSION
- The version of the chef-client to install.
- -c CONFIG_FILE, --config CONFIG_FILE
- The configuration file to use.
- --chef-zero-port PORT
- The port on which chef-zero will listen.
- --[no-]color
- Indicates whether colored output will be used.
- -d DISTRO, --distro DISTRO
- Warning
- The default bootstrap operation uses the omnibus installer, which means
the default template file ( chef-full) should work on all supported
platforms. It is recommended to use custom bootstrap templates only when
the omnibus installer cannot be used.
The template file to be used during a bootstrap operation. The following
distributions are supported:
chef-full (the default bootstrap),
centos5-gems,
fedora13-gems,
ubuntu10.04-gems,
ubuntu10.04-apt,
ubuntu12.04-gems, and the name of a custom
bootstrap template file. When this option is used, Knife will search for the
template file in the following order: the
bootstrap/ folder in the
current working directory, the
bootstrap/ folder in the chef-repo, the
bootstrap/ folder in the
~/.chef/ directory, or a default
bootstrap file. Do not use the
--template-file option when
--distro is specified.
- --defaults
- Indicates that Knife will use the default value, instead of asking a user
to provide one.
- --disable-editing
- Indicates that $EDITOR will not be opened; data will be accepted
as-is.
- -e EDITOR, --editor EDITOR
- The $EDITOR that is used for all interactive commands.
- -E ENVIRONMENT, --environment ENVIRONMENT
- The name of the environment. When this option is added to a command, the
command will run only against the named environment.
- -F FORMAT, --format FORMAT
- The output format: summary (default), text, json,
yaml, and pp.
- -G GATEWAY, --ssh-gateway GATEWAY
- The SSH tunnel or gateway that is used to run a bootstrap action on a
machine that is not accessible from the workstation.
- -h, --help
- Shows help for the command.
- --hint HINT_NAME[=HINT_FILE]
- An Ohai hint to be set on the target of the bootstrap. The hint is
contained in a file and is formatted as JSON:
{"attribute":"value","attribute":"value"...}.
HINT_NAME is the name of the hint and HINT_FILE is the name
of the hint file located at /etc/chef/ohai/hints/HINT_FILE.json.
Use multiple --hint options in the command to specify multiple
hints.
- --[no-]host-key-verify
- Use --no-host-key-verify to disable host key verification. Default
setting: --host-key-verify.
- -i IDENTITY_FILE, --identity-file IDENTITY_FILE
- The SSH identity file used for authentication. Key-based authentication is
recommended.
- -j JSON_ATTRIBS, --json-attributes JSON_ATTRIBS
- A JSON string that is added to the first run of a chef-client.
- -k KEY, --key KEY
- The private key that Knife will use to sign requests made by the API
client to the server.
- -N NAME, --node-name NAME
- The name of the node.
- -p PORT, --ssh-port PORT
- The SSH port.
- -P PASSWORD, --ssh-password PASSWORD
- 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.
- --prerelease
- Indicates that pre-release gems should be installed.
- --print-after
- Indicates that data will be shown after a destructive operation.
- -r RUN_LIST, --run-list RUN_LIST
- A comma-separated list of roles and/or recipes to be applied.
- -s URL, --server-url URL
- The URL for the server.
- --secret SECRET
- The encryption key that is used for values contained within a data bag
item.
- --secret-file FILE
- The path to the file that contains the encryption key.
- --sudo
- Indicates that a bootstrap operation should be executed using sudo.
- --template-file TEMPLATE
- The path to a template file that will be used during a bootstrap
operation. Do not use the --distro option when
--template-file is specified.
- -u USER, --user USER
- The user name used by Knife to sign requests made by the API client to the
server. Authentication will fail if the user name does not match the
private key.
- --use-sudo-password
- Indicates that a bootstrap operation is done using sudo, with the password
specified by the -P (or --ssh-password) option.
- -v, --version
- The version of the chef-client.
- -V, --verbose
- Set for more verbose outputs. Use -VV for maximum verbosity.
- -x USERNAME, --ssh-user USERNAME
- The SSH user name.
- -y, --yes
- Indicates that the response to all confirmation prompts will be
"Yes" (and that Knife will not ask for confirmation).
- -z, --local-mode
- 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.
Examples
$ knife bootstrap 192.168.1.1 -x username -P PASSWORD --sudo
$ knife bootstrap 192.168.1.1 -x username -i ~/.ssh/id_rsa --sudo
AUTHOR¶
Chef