ruby - chef attributes value not getting parsed in another attribute -


i setting attributes in default.rb as

default[:my_app] = {   :vol => "data02",   :commitlog => "/foo/bar/node[:vol]/commitlog", } 

but :vol value not getting parsed in commitlog attribute , getting following error.

merror executing action `create` on resource 'directory[/foo/bar/node[:vol]/comitlog]'[0m 

you're missing string interpolation syntax, e.g. y = "the value of x #{x}." want:

default[:my_app] = {   :vol => "data02",   :commitlog => "/foo/bar/#{node[:vol]}/commitlog", } 

also, keep in mind if make 1 attribute depend on value of another, might override node[:my_app][:vol] later , expect value of node[:my_app][:commitlog] change it, , may not. attributes parsed together, potentially before override affects first one.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -