Puppet: System Administration Automated

Support

Ticket #1115: puppet_erb_classes_tags.patch

File puppet_erb_classes_tags.patch, 1.1 kB (added by johnf, 8 months ago)
  • a/CHANGELOG

    old new  
     1    Fixed #1115 - Add to predefined variables to the ERB template space. "classes" 
     2    and "tags" which provide arrays of all the defined classes and tags 
     3    for a node. 
     4 
    150.24.4 
    26    Pass source to pkg_add via the PKG_PATH environment variable if 
    37    it ends in a '/' indicating it is a directory. Allows pkg_add 
  • a/lib/puppet/parser/templatewrapper.rb

    old new  
    2020        end 
    2121    end 
    2222 
     23    # Allow templates to accss the defined classes 
     24    def classes 
     25        return @scope.compiler.catalog.classes 
     26    end 
     27 
     28    # Allow templates to accss the defined classes 
     29    def tags 
     30        return @scope.compiler.catalog.classes 
     31    end 
     32 
    2333    # Ruby treats variables like methods, so we can cheat here and 
    2434    # trap missing vars like they were missing methods. 
    2535    def method_missing(name, *args)