Sha256: b9592ab7f6be286bac5f63365fb28f565b3ab80d7419822f42ef1d7798155a34

Contents?: true

Size: 898 Bytes

Versions: 62

Compression:

Stored size: 898 Bytes

Contents

# Test whether a given tag is set.  This functions as a big OR -- if any of the specified tags are unset, we return false.
Puppet::Parser::Functions::newfunction(:tagged, :type => :rvalue, :arity => -2, :doc => "A boolean function that
  tells you whether the current container is tagged with the specified tags.
  The tags are ANDed, so that all of the specified tags must be included for
  the function to return true.") do |vals|
    if Puppet[:tasks]
      raise Puppet::ParseErrorWithIssue.from_issue_and_stack(
        Puppet::Pops::Issues::CATALOG_OPERATION_NOT_SUPPORTED_WHEN_SCRIPTING,
        {:operation => 'tagged'})
    end

    configtags = compiler.catalog.tags
    resourcetags = resource.tags

    retval = true
    vals.each do |val|
      unless configtags.include?(val) or resourcetags.include?(val)
        retval = false
        break
      end
    end

    return retval
end

Version data entries

62 entries across 62 versions & 2 rubygems

Version Path
bolt-0.16.4 vendored/puppet/lib/puppet/parser/functions/tagged.rb
bolt-0.16.3 vendored/puppet/lib/puppet/parser/functions/tagged.rb
bolt-0.16.2 vendored/puppet/lib/puppet/parser/functions/tagged.rb
puppet-5.4.0 lib/puppet/parser/functions/tagged.rb
puppet-5.4.0-x86-mingw32 lib/puppet/parser/functions/tagged.rb
puppet-5.4.0-x64-mingw32 lib/puppet/parser/functions/tagged.rb
puppet-5.4.0-universal-darwin lib/puppet/parser/functions/tagged.rb
bolt-0.16.1 vendored/puppet/lib/puppet/parser/functions/tagged.rb
bolt-0.16.0 vendored/puppet/lib/puppet/parser/functions/tagged.rb
bolt-0.15.0 vendored/puppet/lib/puppet/parser/functions/tagged.rb
bolt-0.14.0 vendored/puppet/lib/puppet/parser/functions/tagged.rb
bolt-0.13.0 vendored/puppet/lib/puppet/parser/functions/tagged.rb
bolt-0.12.0 vendored/puppet/lib/puppet/parser/functions/tagged.rb
bolt-0.11.0 vendored/puppet/lib/puppet/parser/functions/tagged.rb
bolt-0.10.0 vendored/puppet/lib/puppet/parser/functions/tagged.rb
bolt-0.9.0 vendored/puppet/lib/puppet/parser/functions/tagged.rb
bolt-0.8.0 vendored/puppet/lib/puppet/parser/functions/tagged.rb
bolt-0.7.0 vendored/puppet/lib/puppet/parser/functions/tagged.rb
bolt-0.6.1 vendored/puppet/lib/puppet/parser/functions/tagged.rb
bolt-0.6.0 vendored/puppet/lib/puppet/parser/functions/tagged.rb