vendored/puppet/lib/puppet/functions/hiera_include.rb in bolt-0.20.3 vs vendored/puppet/lib/puppet/functions/hiera_include.rb in bolt-0.20.5

- old
+ new

@@ -1,18 +1,18 @@ require 'hiera/puppet_function' # Assigns classes to a node using an -# [array merge lookup](https://docs.puppetlabs.com/hiera/latest/lookup_types.html#array-merge) +# [array merge lookup](https://puppet.com/docs/hiera/latest/lookup_types.html#array-merge) # that retrieves the value for a user-specified key from Hiera's data. # # This function is deprecated in favor of the `lookup` function in combination with `include`. # While this function continues to work, it does **not** support: # * `lookup_options` stored in the data # * lookup across global, environment, and module layers # # @example Using `lookup` and `include` instead of of the deprecated `hiera_include` -# +# # ```puppet # # In site.pp, outside of any node definitions and below any top-scope variables: # lookup('classes', Array[String], 'unique').include # ``` # @@ -30,17 +30,17 @@ # 1. A string key that Hiera searches for in the hierarchy. **Required**. # 2. An optional default value to return if Hiera doesn't find anything matching the key. # * If this argument isn't provided and this function results in a lookup failure, Puppet # fails with a compilation error. # 3. The optional name of an arbitrary -# [hierarchy level](https://docs.puppetlabs.com/hiera/latest/hierarchy.html) to insert at the +# [hierarchy level](https://puppet.com/docs/hiera/latest/hierarchy.html) to insert at the # top of the hierarchy. This lets you temporarily modify the hierarchy for a single lookup. # * If Hiera doesn't find a matching key in the overriding hierarchy level, it continues # searching the rest of the hierarchy. # # The function uses an -# [array merge lookup](https://docs.puppetlabs.com/hiera/latest/lookup_types.html#array-merge) +# [array merge lookup](https://puppet.com/docs/hiera/latest/lookup_types.html#array-merge) # to retrieve the `classes` array, so every node gets every class from the hierarchy. # # @example Using `hiera_include` # # ```yaml @@ -64,11 +64,11 @@ # # # Puppet assigns the apache and apache::mod::php classes to the web01.example.com node. # ``` # # You can optionally generate the default value with a -# [lambda](https://docs.puppetlabs.com/puppet/latest/reference/lang_lambdas.html) that +# [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) that # takes one parameter. # # @example Using `hiera_include` with a lambda # # ```puppet @@ -81,12 +81,12 @@ # # If hiera_include couldn't match its key, it would return the lambda result, # # "Key 'classes' not found". # ``` # # See -# [the 'Using the lookup function' documentation](https://docs.puppet.com/puppet/latest/hiera_use_function.html) for how to perform lookup of data. +# [the 'Using the lookup function' documentation](https://puppet.com/docs/puppet/latest/hiera_automatic.html) for how to perform lookup of data. # Also see -# [the 'Using the deprecated hiera functions' documentation](https://docs.puppet.com/puppet/latest/hiera_use_hiera_functions.html) +# [the 'Using the deprecated hiera functions' documentation](https://puppet.com/docs/puppet/latest/hiera_automatic.html) # for more information about the Hiera 3 functions. # # @since 4.0.0 # Puppet::Functions.create_function(:hiera_include, Hiera::PuppetFunction) do