Skip to content

Commit

Permalink
Use lazy evaluation for config_dir attribute
Browse files Browse the repository at this point in the history
Fixes #151

Tested changes with ubuntu 14.04 and 12.04
  • Loading branch information
Maniacal authored and jeffbyrnes committed Dec 21, 2015
1 parent bdd2445 commit 6750ea8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion attributes/default.rb
Expand Up @@ -9,7 +9,7 @@
default[:zookeeper][:install_dir] = '/opt/zookeeper'
default[:zookeeper][:use_java_cookbook] = true
default[:zookeeper][:config_dir] = "#{node[:zookeeper][:install_dir]}/" \
"zookeeper-#{node[:zookeeper][:version]}/conf"
'zookeeper-%{zookeeper_version}/conf'
default[:zookeeper][:conf_file] = 'zoo.cfg'
default[:zookeeper][:java_opts] = "-Xms128M -Xmx512M"
default[:zookeeper][:log_dir] = "/var/log/zookeeper"
Expand Down
3 changes: 2 additions & 1 deletion recipes/config_render.rb
Expand Up @@ -16,7 +16,8 @@

# set the config path based on default attributes
# render out our config
zookeeper_config "#{node[:zookeeper][:config_dir]}/#{node[:zookeeper][:conf_file]}" do
zookeeper_config "zookeeper config" do
path "#{node[:zookeeper][:config_dir] % { zookeeper_version: node[:zookeeper][:version] }}/#{node[:zookeeper][:conf_file]}"
config node[:zookeeper][:config]
user node[:zookeeper][:user]
action :render
Expand Down

0 comments on commit 6750ea8

Please sign in to comment.