I have a problem with my executing command string in chef, because it doesn’t see my declaration as a variable instead he will use the “name” of the variable. I tried it with attributes aso but the result will be the same
This is my recipe:
Update and restart ntp-deamon
NTP is the variable for Server1(first) and the Server(second)
execute “Set time to NTP Time now” do
command ‘/usr/sbin/ntpdate <%= node[:ntp][:first] %>’ => should be "command ‘/usr/sbin/ntpdate 220.127.116.11’ "
That is what chef will see if I execute it:
handle_command_failures’: /usr/sbin/ntpdate <%= node[:ntp][:first] %> returned 2, expected 0
Have anybody a similar problem and could resolve it?!
Best regards and thanks for the help