Foreman Modules and Smart Class Parameter


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' => [
      '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:


Foreman and Proxy plugin versions:

Other relevant data:
Puppet Module imported into Foreman

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:

  - 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.