file node['remote_syslog2']['config_file'] do
  content node['remote_syslog2']['config'].to_hash.to_yaml
  mode '0644'
  notifies :restart, 'service[remote_syslog2]', :delayed
end
file node['remote_syslog2']['config_file'] do
  # Using JSON.parse(x.to_json) to convert Chef::Node::ImmutableArray and
  # Chef::Node::ImmutableMash to plain Ruby array and hash.
  # https://tickets.opscode.com/browse/CHEF-3953
  content JSON.parse(node['remote_syslog2']['config'].to_json).to_yaml

  mode '0644'
  notifies :restart, 'service[remote_syslog2]', :delayed
end
Fix generated config file on Chef 11.14.
Fix generated config file on Chef 11.14.

The config file generated looks like this on Chef 11.14 and
remote_syslog2 can't understand it:

    files: !ruby/array:Chef::Node::ImmutableArray
    - /foo/bar
    exclude_files: !ruby/array:Chef::Node::ImmutableArray []
    exclude_patterns: !ruby/array:Chef::Node::ImmutableArray []
    hostname: foo.com
    destination: !ruby/hash:Chef::Node::ImmutableMash
      host: bar.com
      port: 12345
      protocol: tls
