I am new to the chef framework. I want to keep some of my data values such as shared location path, username, password in databag (without encrypting) and refer them in a recipe rather than hard coding them, but when I refer to them in the recipe, the reference is not getting evaluated.
Please find below the script sample I used:
databag details: databag name = ak-databag
databag_item name= uncpath
databag entries- id: uncpath
unc-path: \\ec2-999-333-111-444.ap-southeast-1.compute.amazonaws.com\share
script:
batch "Copy_product1_and_product2"
code <<-EOH
net use "my_bag["unc-path"]" password /user:username
xcopy "my_bag["unc-path"]\\product1.exe" "C:\\my-Package1" /y /S
xcopy "my_bag["unc-path"]\\product2.exe" "C:\\my-Package2" /y /S
EOH
end