Foreman Modules and Smart Class Parameter

Problem:

What’s the best way to set more complicated smart class parameter in Foreman.

I’m using the elasticsearch module and I want to use something like the following -

class { 'filebeat':
  outputs => {
    'logstash'     => {
      'hosts' => [
        'localhost:5044',
        'anotherserver:5044'
      ],
      'loadbalance' => true,
    },
  },
}

now for setting a simple string I find it easy eg just set “logstash” but is it better to set the above code as array, yaml, json?

Expected outcome:

Use foreman to set filebeat.yml to use logstash on all RHEL hosts.

Foreman and Proxy versions:

1.16.0

Foreman and Proxy plugin versions:

Other relevant data:
Puppet Module imported into Foreman

https://forge.puppet.com/pcfens/filebeat

I prefer YAML for this kind of smart class param, but it’s personal preference. Leaving aside matchers per host/group/etc and working with just the default value for the “outputs” parameter, I think this should work:

logstash:
  hosts:
  - localhost:5044
  - anotherserver:5044
  loadbalance: true

Whitespace matters for YAML of course, and passing booleans can be tricky, so you may have more luck with JSON, but hopefully that will get you started.