Chef

Table Of Contents

knife tag

A tag is a custom description that is applied to a node. A tag, once applied, can be helpful when managing nodes using Knife or when building recipes by providing alternate methods of grouping similar types of information.

The knife tag subcommand is used to apply tags to nodes on a server.

Note

Review the list of common options available to this (and all) Knife subcommands and plugins.

create

The create argument is used to add one or more tags to a node.

Syntax

This argument has the following syntax:

$ knife tag create NODE_NAME [TAG...]

Options

This command does not have any specific options.

Examples

The following examples show how to use this Knife subcommand:

Create tags

To create tags named “seattle”, “portland”, and “vancouver”, enter:

$ knife tag create node seattle portland vancouver

delete

The delete argument is used to delete one or more tags from a node.

Syntax

This argument has the following syntax:

$ knife tag delete NODE_NAME [TAG...]

Options

This command does not have any specific options.

Examples

The following examples show how to use this Knife subcommand:

Delete tags

To delete tags named “denver” and “phoenix”, enter:

$ knife tag delete node denver phoenix

Type Y to confirm a deletion.

list

The list argument is used to list all of the tags that have been applied to a node.

Syntax

This argument has the following syntax:

$ knife tag list [NODE_NAME...]

Options

This command does not have any specific options.

Examples

The following examples show how to use this Knife subcommand:

View a list of tags

To view the tags for a node named “devops_prod1”, enter:

$ knife tag list devops_prod1