Sha256: 169ed9c9950bc83e911dd502f3ff2d7cb70e789501a3e99567a2abb34e9c536b

Contents?: true

Size: 855 Bytes

Versions: 20

Compression:

Stored size: 855 Bytes

Contents

# frozen_string_literal: true
# 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

    retval = true
    vals.each do |val|
      unless compiler.catalog.tagged?(val) or resource.tagged?(val)
        retval = false
        break
      end
    end

    return retval
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
puppet-8.3.0 lib/puppet/parser/functions/tagged.rb
puppet-8.3.0-x86-mingw32 lib/puppet/parser/functions/tagged.rb
puppet-8.3.0-x64-mingw32 lib/puppet/parser/functions/tagged.rb
puppet-8.3.0-universal-darwin lib/puppet/parser/functions/tagged.rb
puppet-8.3.1 lib/puppet/parser/functions/tagged.rb
puppet-8.3.1-x86-mingw32 lib/puppet/parser/functions/tagged.rb
puppet-8.3.1-x64-mingw32 lib/puppet/parser/functions/tagged.rb
puppet-8.3.1-universal-darwin lib/puppet/parser/functions/tagged.rb
puppet-8.2.0 lib/puppet/parser/functions/tagged.rb
puppet-8.2.0-x86-mingw32 lib/puppet/parser/functions/tagged.rb
puppet-8.2.0-x64-mingw32 lib/puppet/parser/functions/tagged.rb
puppet-8.2.0-universal-darwin lib/puppet/parser/functions/tagged.rb
puppet-8.1.0 lib/puppet/parser/functions/tagged.rb
puppet-8.1.0-x86-mingw32 lib/puppet/parser/functions/tagged.rb
puppet-8.1.0-x64-mingw32 lib/puppet/parser/functions/tagged.rb
puppet-8.1.0-universal-darwin lib/puppet/parser/functions/tagged.rb
puppet-8.0.1 lib/puppet/parser/functions/tagged.rb
puppet-8.0.1-x86-mingw32 lib/puppet/parser/functions/tagged.rb
puppet-8.0.1-x64-mingw32 lib/puppet/parser/functions/tagged.rb
puppet-8.0.1-universal-darwin lib/puppet/parser/functions/tagged.rb