diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-04-11 15:30:19 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-04-11 15:30:19 +0000 |
| commit | 4d750418d00bdd39118493003d60481a35212ed1 (patch) | |
| tree | 4b2e74ff66e9a0f5f2a69529986595c2dcccc95f /lib/puppet | |
| parent | 201aa023dd279d2d968a97732db11a1933665562 (diff) | |
| download | puppet-4d750418d00bdd39118493003d60481a35212ed1.tar.gz puppet-4d750418d00bdd39118493003d60481a35212ed1.tar.xz puppet-4d750418d00bdd39118493003d60481a35212ed1.zip | |
Adding a "tag" metaparam
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1099 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/type.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index 8ce39ce29..afea4dfa6 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -2229,6 +2229,29 @@ class Type < Puppet::Element end end end + + newmetaparam(:tag) do + desc "Add the specified tags to the associated element. While all elements + are automatically tagged with as much information as possible + (e.g., each class and component containing the element), it can + be useful to add your own tags to a given element. + + Tags are currently useful for things like applying a subset of a + host's configuration: + + puppetd -v --tag mytag --onetime + + This way, when you're testing a configuration you can run just the + portion you're testing." + + munge do |tags| + tags = [tags] unless tags.is_a? Array + + tags.each do |tag| + @parent.tag(tag) + end + end + end end # Puppet::Type end |
