basho-labs/riak-chef-cookbook

can't modify platform_log_dir

Closed this issue · 1 comments

I'm writing a wrapper for this cookbook and testing it with test kitchen using chef_zero. I'm not sure what is going on, but there seems to be some caching occurring so that the /etc/riak/riak.conf file is not getting modified when I change the platform_log_dir attribute after I have already run it once and installed riak. Is this a feature or a bug?

# move the default log directory when the riak cookbook installs riak
node.set['riak']['platform_log_dir'] = '/var/log/foobar/riak'

# Installs riak on this node. Do not do a Java install.
include_recipe 'riak'

Shouldn't there be a way to modify config file contents without uninstalling riak? Wouldn't using a template for riak.conf prevent this from occurring?

Definitely a bug as obviously there should be a way to modify the config file - it does appear that the transition to the 3.x series overlooked testing configuration after the first run. While a template may seem like a good idea, the Cuttlefish library is needed to handle some of the idiosyncrasies of the riak.conf construction.

The issue that the content was not being "lazily" evaluated such that the value would only be set during Chef's compile phase. Fixed in #184.