W3cubDocs

/Chef 12

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

Note

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

create

Use the create argument 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

Use the delete argument 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

Use the list argument 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

© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs-archive.chef.io/release/12-13/knife_tag.html