0

I have a problem when using search inside a chef recipe:

  • When my cookbook runs using chefserver, the next search is successfull: search(:node, %Q{nginx_vhosts_#{name}:*})
  • When my cookbook runs using chef-zero (with kitchen) it is not successful, it could not find nothing.

I have configured correctly the nodes_path in my .kitchen.yml file. I could find a workaround using search like: search(:node, %Q{nginx:vhosts}) and adding after some logic to match my purposes.

So my question is: Why the syntax search(:node, param1_param2_#{var}:*) is not working?

albs
  • 13
  • 4
  • 1
    This style syntax works for me using chef_zero and test kitchen, search(:node, "nginx_vhosts_#{name}:*" ). Maybe you have something misconfigured in your kitchen.yml. You shouldn't need anything special in .kitchen.yml if you added .json files for the nodes you want in the right spot, eg. test/integration/nodes/nginx_vhosts_example1.json. – John Lemp Jul 07 '15 at 21:28
  • thanks @duckworth, at least I know that is working for someone. My nodes are in json format and stored in the correct place. I guess my kitchen.yml is correct. I am using chef 11.12.8, are you using chef 12? – albs Jul 08 '15 at 15:11
  • Yes, I am using chef 12. – John Lemp Jul 09 '15 at 09:51
  • I tried with chef 12 and same result. This is not even more an issue, but I would like to find the problem. I will face this problem again, and will find why – albs Jul 09 '15 at 13:08

0 Answers0