Noob: issue with the foreman_config_entry type when using 'trusted_puppetmaster_hosts'

Problem:
I have tried all sorts of different combinations
foreman_config_entry { ‘trusted_puppetmaster_hosts’:
value => $puppetmaster,
notify => Service[‘foreman’]
}
Expected outcome:
Based on this information, what I am trying to do should work, yet there seems to be a bug where an apostrophe is being added to any text input into the field.

Example:
Error:

NoMethodError: undefined method `settings_type' for nil:NilClass
/usr/share/foreman/lib/tasks/config.rake:105:in `block in run_key_values'
/usr/share/foreman/lib/tasks/config.rake:100:in `each'
/usr/share/foreman/lib/tasks/config.rake:100:in `run_key_values'
/usr/share/foreman/lib/tasks/config.rake:77:in `run'
/usr/share/foreman/lib/tasks/config.rake:167:in `block in <top (required)>'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => config
(See full trace by running task with --trace)
Error: /Stage[main]/Profile::Foreman_server/Foreman_config_entry[trusted_puppetmaster_hosts]/value: change from '' to '[puppetmaster.vagrant]' failed: Execution of '/usr/sbin/foreman-rake -- config -k 'trusted_puppetmaster_hosts' -v '[puppetmaster.vagrant]'' returned 1: rake aborted!
NoMethodError: undefined method `settings_type' for nil:NilClass
/usr/share/foreman/lib/tasks/config.rake:105:in `block in run_key_values'
/usr/share/foreman/lib/tasks/config.rake:100:in `each'
/usr/share/foreman/lib/tasks/config.rake:100:in `run_key_values'
/usr/share/foreman/lib/tasks/config.rake:77:in `run'
/usr/share/foreman/lib/tasks/config.rake:167:in `block in <top (required)>'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => config
(See full trace by running task with --trace)
Tasks: TOP => config```

**Foreman and Proxy versions:**
Foreman - 1.20.1
Proxy not installed

Under the hood it calls foreman-rake config. You can see the exact command it’s trying to execute:

/usr/sbin/foreman-rake -- config -k 'trusted_puppetmaster_hosts' -v '[puppetmaster.vagrant]'

In the help it mentions that complex values (hashes, arrays) are expected to be JSON encoded so I’d try to use ["puppetmaster.vagrant"] as a value instead.

The provider could do this JSON encoding for you if it sees a complex type though. I’d welcome a patch to do this.