Puppet Function: merge_config

Defined in:
modules/service/lib/puppet/parser/functions/merge_config.rb
Function type:
Ruby 3.x API

Overview

merge_config()Any

Returns:

  • (Any)


14
15
16
17
18
19
20
21
22
# File 'modules/service/lib/puppet/parser/functions/merge_config.rb', line 14

newfunction(:merge_config, :type => :rvalue, :arity => 2) do |args|
  main_conf, service_conf = *args.map { |arg|  config_to_hash(arg)}
  begin
    main_conf['services'][0]['conf'].update service_conf
  rescue
    fail('Badly formatted configuration.')
  end
  call_function('to_yaml', [main_conf])
end