Tags

Not all virtual resources are independent from each other. Sometimes, we want to generate a collection of resources that we can realize together as a group. Puppet provides a metaparameter called a tag that allows us to categorize resources together. Tags allow us to run a subset of Puppet code using puppet agent -t --tags <tag>. They provide a user-specific marking of a resource in order to build a collection of similar objects. Tags are an array, so you can apply more than one tag to a resource, but still call them separately. Virtual resources with tags can be called with a resource collector, sometimes called the spaceship operator. The simple format for calling resources by a tag is Resource <| |>. Inside of the two pipes, you can ...

Get Mastering Puppet 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.