Functions
deeper_merge
: Recursively merges two or more hashes together and returns the resulting hash. For example: $hash1 = {'one' => 1, 'two' => 2, 'three' =hiera_facts::facts_backend
:
Type: Ruby 3.x API
Recursively merges two or more hashes together and returns the resulting hash.
For example:
$hash1 = {'one' => 1, 'two' => 2, 'three' => { 'four' => 4 } }
$hash2 = {'two' => 'dos', 'three' => { 'five' => 5 } }
$merged_hash = deeper_merge($hash1, $hash2)
# The resulting hash is equivalent to:
# $merged_hash = { 'one' => 1, 'two' => 'dos', 'three' => { 'four' => 4, 'five' => 5 } }
$hash1 = { 'key1' => [ 'arrayvalue1', 'arrayvalue2' ] }
$hash2 = { 'key1' => [ 'arrayvalue2', 'arrayvalue3' ] }
$merged_hash = deeper_merge($hash1, $hash2)
# The resulting hash is equivalent to:
# $merged_hash = { key1' => [ 'arrayvalue1', 'arrayvalue2', 'arrayvalue3' ] }
When there is a duplicate key that is a hash, they are recursively merged. When there is a duplicate key that is an array, they are recursively merged with duplicates removed. When there is a duplicate key that is not a hash or an array, the key in the rightmost hash will "win
Recursively merges two or more hashes together and returns the resulting hash.
For example:
$hash1 = {'one' => 1, 'two' => 2, 'three' => { 'four' => 4 } }
$hash2 = {'two' => 'dos', 'three' => { 'five' => 5 } }
$merged_hash = deeper_merge($hash1, $hash2)
# The resulting hash is equivalent to:
# $merged_hash = { 'one' => 1, 'two' => 'dos', 'three' => { 'four' => 4, 'five' => 5 } }
$hash1 = { 'key1' => [ 'arrayvalue1', 'arrayvalue2' ] }
$hash2 = { 'key1' => [ 'arrayvalue2', 'arrayvalue3' ] }
$merged_hash = deeper_merge($hash1, $hash2)
# The resulting hash is equivalent to:
# $merged_hash = { key1' => [ 'arrayvalue1', 'arrayvalue2', 'arrayvalue3' ] }
When there is a duplicate key that is a hash, they are recursively merged. When there is a duplicate key that is an array, they are recursively merged with duplicates removed. When there is a duplicate key that is not a hash or an array, the key in the rightmost hash will "win
Returns: Any
Type: Puppet Language
The hiera_facts::facts_backend function.
The hiera_facts::facts_backend function.
Returns: Hash[RichDataKey, RichData]
Returns a hash that contains all collected hiera data for the given configuration.
Data type: Hash
Configure fact(s) and path(s) details to be used by the backend.
Data type: Puppet::LookupContext
We ignore this argument, it is mandatory for a function to accept it.