Sha256: cd33631176cfee45feff303657ecb7167d5c33cbed0084ec3da5aad83b34a330

Contents?: true

Size: 1.64 KB

Versions: 50

Compression:

Stored size: 1.64 KB

Contents

# Include the specified classes
Puppet::Parser::Functions::newfunction(:include, :arity => -2, :doc =>
"Declares one or more classes, causing the resources in them to be
evaluated and added to the catalog. Accepts a class name, an array of class
names, or a comma-separated list of class names.

The `include` function can be used multiple times on the same class and will
only declare a given class once. If a class declared with `include` has any
parameters, Puppet will automatically look up values for them in Hiera, using
`<class name>::<parameter name>` as the lookup key.

Contrast this behavior with resource-like class declarations
(`class {'name': parameter => 'value',}`), which must be used in only one place
per class and can directly set parameters. You should avoid using both `include`
and resource-like declarations with the same class.

The `include` function does not cause classes to be contained in the class
where they are declared. For that, see the `contain` function. It also
does not create a dependency relationship between the declared class and the
surrounding class; for that, see the `require` function.

When the future parser is used, you must use the class's full name;
relative names are no longer allowed. In addition to names in string form,
you may also directly use Class and Resource Type values that are produced by
the future parser's resource and relationship expressions.

") do |vals|

  # Unify call patterns (if called with nested arrays), make names absolute if
  # wanted and evaluate the classes
  compiler.evaluate_classes(
  transform_and_assert_classnames(
      vals.is_a?(Array) ? vals.flatten : [vals]),
      self, false)
end

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
puppet-retrospec-0.12.2 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/include.rb
puppet-3.8.7 lib/puppet/parser/functions/include.rb
puppet-3.8.7-x86-mingw32 lib/puppet/parser/functions/include.rb
puppet-3.8.7-x64-mingw32 lib/puppet/parser/functions/include.rb
puppet-3.8.6 lib/puppet/parser/functions/include.rb
puppet-3.8.6-x86-mingw32 lib/puppet/parser/functions/include.rb
puppet-retrospec-0.12.1 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/include.rb
puppet-3.8.6-x64-mingw32 lib/puppet/parser/functions/include.rb
puppet-retrospec-0.12.0 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/include.rb
puppet-3.8.5 lib/puppet/parser/functions/include.rb
puppet-3.8.5-x86-mingw32 lib/puppet/parser/functions/include.rb
puppet-3.8.5-x64-mingw32 lib/puppet/parser/functions/include.rb
puppet-3.8.4 lib/puppet/parser/functions/include.rb
puppet-3.8.4-x86-mingw32 lib/puppet/parser/functions/include.rb
puppet-3.8.4-x64-mingw32 lib/puppet/parser/functions/include.rb
puppet-retrospec-0.11.0 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/include.rb
puppet-retrospec-0.10.0 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/include.rb
puppet-retrospec-0.9.1 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/include.rb
puppet-retrospec-0.9.0 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/include.rb
puppet-retrospec-0.8.1 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/include.rb