Skip to content

Commit

Permalink
Fix generated config file on Chef 11.14.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
htanata committed Jan 21, 2016
1 parent 0864473 commit 4b50234
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion recipes/configure.rb
@@ -1,5 +1,9 @@
file node['remote_syslog2']['config_file'] do
content node['remote_syslog2']['config'].to_hash.to_yaml
# 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

0 comments on commit 4b50234

Please sign in to comment.