Sha256: 434be80ccbafb7f3090e055cdb043db31b27a567847722acdd6f496821e1b40f

Contents?: true

Size: 1.6 KB

Versions: 80

Compression:

Stored size: 1.6 KB

Contents

# Requires the specified classes

  Puppet::Parser::Functions::newfunction(
    :require,
    :arity => -2,
    :doc =>"Evaluate one or more classes,  adding the required class as a dependency.

The relationship metaparameters work well for specifying relationships
between individual resources, but they can be clumsy for specifying
relationships between classes.  This function is a superset of the
'include' function, adding a class relationship so that the requiring
class depends on the required class.

Warning: using require in place of include can lead to unwanted dependency cycles.

For instance the following manifest, with 'require' instead of 'include' would produce a nasty dependence cycle, because notify imposes a before between File[/foo] and Service[foo]:

    class myservice {
      service { foo: ensure => running }
    }

    class otherstuff {
      include myservice
      file { '/foo': notify => Service[foo] }
    }

Note that this function only works with clients 0.25 and later, and it will
fail if used with earlier clients.

You must use the class's full name;
relative names are not allowed. In addition to names in string form,
you may also directly use Class and Resource Type values that are produced when evaluating
resource and relationship expressions.

- Since 4.0.0 Class and Resource types, absolute names
- Since 4.7.0 Returns an Array[Type[Class]] with references to the required classes
") do |classes|
  Puppet.warn_once(:deprecation, '3xfunction#require', "Calling function_require via the Scope class is deprecated. Use Scope#call_function instead")
  call_function('require', classes)
end

Version data entries

80 entries across 80 versions & 2 rubygems

Version Path
puppet-retrospec-1.8.0 vendor/pup410/lib/puppet/parser/functions/require.rb
puppet-retrospec-1.7.0 vendor/pup410/lib/puppet/parser/functions/require.rb
puppet-4.10.12 lib/puppet/parser/functions/require.rb
puppet-4.10.12-x86-mingw32 lib/puppet/parser/functions/require.rb
puppet-4.10.12-x64-mingw32 lib/puppet/parser/functions/require.rb
puppet-4.10.12-universal-darwin lib/puppet/parser/functions/require.rb
puppet-4.10.11 lib/puppet/parser/functions/require.rb
puppet-4.10.11-x86-mingw32 lib/puppet/parser/functions/require.rb
puppet-4.10.11-x64-mingw32 lib/puppet/parser/functions/require.rb
puppet-4.10.11-universal-darwin lib/puppet/parser/functions/require.rb
puppet-4.10.10 lib/puppet/parser/functions/require.rb
puppet-4.10.10-x86-mingw32 lib/puppet/parser/functions/require.rb
puppet-4.10.10-x64-mingw32 lib/puppet/parser/functions/require.rb
puppet-4.10.10-universal-darwin lib/puppet/parser/functions/require.rb
puppet-retrospec-1.6.1 vendor/pup410/lib/puppet/parser/functions/require.rb
puppet-retrospec-1.6.0 vendor/pup410/lib/puppet/parser/functions/require.rb
puppet-4.10.9 lib/puppet/parser/functions/require.rb
puppet-4.10.9-x86-mingw32 lib/puppet/parser/functions/require.rb
puppet-4.10.9-x64-mingw32 lib/puppet/parser/functions/require.rb
puppet-4.10.9-universal-darwin lib/puppet/parser/functions/require.rb