trusty (1) knife-node.1.gz

Provided by: chef_11.8.2-2_all bug

NAME

       knife-node - The man page for the knife node subcommand.

       A node is any physical, virtual, or cloud machine that is configured to be maintained by a chef-client.

       The knife node subcommand is used to manage the nodes that exist on a server.

       This subcommand has the following syntax:

       $ knife node [ARGUMENT] (options)

COMMON OPTIONS

       The following options can be run with all Knife sub-commands and plug-ins:

       -c CONFIG, --config CONFIG
              The configuration file to use.

       --color
              Indicates that colored output will be used.

       -d, --disable-editing
              Indicates that $EDITOR will not be opened; data will be accepted as-is.

       --defaults
              Indicates that Knife will use the default value, instead of asking a user to provide one.

       -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 FILE_NAME, --file FILE_NAME
              Indicates that the private key will be saved to a specified file name.

       -F FORMAT, --format FORMAT
              The output format: summary (default), text, json, yaml, and pp.

       -h, --help
              Shows help for the command.

       -k KEY, --key KEY
              The private key that Knife will use to sign requests made by the API client to the server.

       --no-color
              Indicates that color will not be used in the output.

       -p PASSWORD, --password PASSWORD
              The user password.

       --print-after
              Indicates that data will be shown after a destructive operation.

       -s URL, --server-url URL
              The URL for the server.

       -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.

       -v, --version
              The version of the chef-client.

       -V, --verbose
              Set for more verbose outputs. Use -VV for maximum verbosity.

       -y, --yes
              Indicates that the response to all confirmation prompts will be "Yes" (and that Knife will not ask
              for confirmation).

BULK DELETE

       The bulk delete argument is used to delete one or more nodes that match a pattern defined  by  a  regular
       expression. The regular expression must be within quotes and not be surrounded by forward slashes (/).

       Syntax

       This argument has the following syntax:

       $ knife node bulk delete REGEX

       Options

       This command does not have any specific options.

       Examples

       To bulk delete many nodes, use a regular expression to define the pattern:

       $ knife node bulk delete "^[0-9]{3}$"

       Type Y to confirm a deletion.

CREATE

       The create argument is used to add a node to the server. Node data is stored as JSON on the server.

       Syntax

       This argument has the following syntax:

       $ knife node create NODE_NAME

       Options

       This command does not have any specific options.

       Examples

       To add a node, enter:

       $ knife node create node1

       In the $EDITOR enter the node data in JSON:

       ## sample:
       {
          "normal": {
          },
          "name": "foobar",
          "override": {
          },
          "default": {
          },
          "json_class": "Chef::Node",
          "automatic": {
          },
          "run_list": [
             "recipe[zsh]",
             "role[webserver]"
          ],
          "chef_type": "node"
       }

       When finished, save it.

DELETE

       The delete argument is used to delete a node from the server.

       Note   Deleting a node will not delete any corresponding API clients.

       Syntax

       This argument has the following syntax:

       $ knife node delete NODE_NAME

       Options

       This command does not have any specific options.

       Examples

       To delete a node called "dev", enter:

       $ knife node delete dev

EDIT

       The  edit  argument is used to edit the details of a node on a server. Node data is stored as JSON on the
       server.

       Syntax

       This argument has the following syntax:

       $ knife node edit NODE_NAME (options)

       Options

       This argument has the following options:

       -a, --all
              Displays a node in the $EDITOR. By default, attributes that are default,  override,  or  automatic
              are not shown.

       Examples

       To edit the data for a node named "node1", enter:

       $ knife node edit node1 -a

       Update the role data in JSON:

       ## sample:
       {
          "normal": {
          },
          "name": "node1",
          "override": {
          },
          "default": {
          },
          "json_class": "Chef::Node",
          "automatic": {
          },
          "run_list": [
             "recipe[devops]",
             "role[webserver]"
          ],
          "chef_type": "node"
       }

       When finished, save it.

FROM FILE

       The from file argument is used to create a node using existing node data as a template.

       Syntax

       This argument has the following syntax:

       $ knife node from file FILE

       Options

       This command does not have any specific options.

       Examples

       To add a node using data contained in a JSON file:

       $ knife node from file "path to JSON file"

LIST

       The list argument is used to view all of the nodes that exist on a server.

       Syntax

       This argument has the following syntax:

       $ knife node list (options)

       Options

       This argument has the following options:

       -w, --with-uri
              Indicates that the corresponding URIs will be shown.

       Examples

       To verify the list of nodes that are registered with the server, enter:

       $ knife node list

       to return something similar to:

       i-12345678
       rs-123456

RUN_LIST ADD

       The run_list add argument is used to add run list items (roles or recipes) to a node. A recipe must be in
       one of the following formats: fully qualified, cookbook, or default. Both roles and recipes  must  be  in
       quotes,  for example: 'role[ROLE_NAME]' or 'recipe[COOKBOOK::RECIPE_NAME]'. Use a comma to separate roles
       and        recipes        when        adding        more        than        one,        like        this:
       'recipe[COOKBOOK::RECIPE_NAME],COOKBOOK::RECIPE_NAME,role[ROLE_NAME]'.

       Syntax

       This argument has the following syntax:

       $ knife node run_list add NODE_NAME RUN_LIST_ITEM (options)

       Options

       This argument has the following options:

       -a ITEM, --after ITEM
              Use this to add the run list item after the specified run list item.

       Examples

       To add a role to a run list, enter:

       $ knife node run_list add node 'role[ROLE_NAME]'

       To add roles and recipes to a run list, enter:

       $ knife node run_list add node 'recipe[COOKBOOK::RECIPE_NAME],recipe[COOKBOOK::RECIPE_NAME],role[ROLE_NAME]'

       To add a recipe to a run list using the fully qualified format, enter:

       $ knife node run_list add node 'recipe[COOKBOOK::RECIPE_NAME]'

       To add a recipe to a run list using the cookbook format, enter:

       $ knife node run_list add node 'COOKBOOK::RECIPE_NAME'

       To add the default recipe of a cookbook to a run list, enter:

       $ knife node run_list add node 'COOKBOOK'

RUN_LIST REMOVE

       The  run_list  remove  argument is used to remove run list items (roles or recipes) from a node. A recipe
       must be in one of the following formats: fully qualified, cookbook, or default. Both  roles  and  recipes
       must  be  in  quotes,  for  example: 'role[ROLE_NAME]' or 'recipe[COOKBOOK::RECIPE_NAME]'. Use a comma to
       separate    roles     and     recipes     when     removing     more     than     one,     like     this:
       'recipe[COOKBOOK::RECIPE_NAME],COOKBOOK::RECIPE_NAME,role[ROLE_NAME]'.

       Syntax

       This argument has the following syntax:

       $ knife node run_list remove NODE_NAME RUN_LIST_ITEM

       Options

       This command does not have any specific options.

       Examples

       To remove a role from a run list, enter:

       $ knife node run_list remove node 'role[ROLE_NAME]'

       To remove a recipe from a run list using the fully qualified format, enter:

       $ knife node run_list remove node 'recipe[COOKBOOK::RECIPE_NAME]'

SHOW

       The show argument is used to display information about a node.

       Syntax

       This argument has the following syntax:

       $ knife node show NODE_NAME (options)

       Options

       This argument has the following options:

       -a ATTR, --attribute ATTR
              The attribute (or attributes) to show.

       -l, --long
              Display long output when searching nodes while using the default summary format.

       -m, --medium
              Display more, but not all, of a node's data when searching using the default summary format.

       -r, --run-list
              Indicates that only the run-list will be shown.

       Examples

       To view all data for a node named "build", enter:

       $ knife node show build

       to return:

       Node Name:   build
       Environment: _default
       FQDN:
       IP:
       Run List:
       Roles:
       Recipes:
       Platform:

       To show basic information about a node, truncated and nicely formatted:

       knife node show <node_name>

       To show all information about a node, nicely formatted:

       knife node show -l <node_name>

       To list a single node attribute:

       knife node show <node_name> -a <attribute_name>

       where  <attribute_name>  is  something  like kernel or platform. (This doesn't work for nested attributes
       like node[kernel][machine] because knife node show doesn't understand nested attributes.)

       To view the FQDN for a node named "i-12345678", enter:

       $ knife node show i-12345678 -a fqdn

       to return:

       fqdn: ip-10-251-75-20.ec2.internal

       To view the run list for a node named "dev", enter:

       $ knife node show dev -r

       To view information in JSON format, use the -F common option as part of the command like this:

       $ knife role show devops -F json

       Other formats available include text, yaml, and pp.

       To view node information in raw JSON, use the -l or --long option:

       knife node show -l -F json <node_name>

       and/or:

       knife node show -l --format=json <node_name>

AUTHOR

       Opscode

                                                   Chef 11.8.0                                     KNIFE-NODE(1)