Is it possible to use the chef-provisioning resources from test kitchen, from inside a regular recipe?
We’ve created a cookbook which currently lets us create various nodes defined in suites in .kitchen.yml. For one of the nodes, we need to run a registration command on another, previously instantiated node. We do it by using the kitchen-nodes provisioner, searching for the target node from whithin the recipe, and use ssh to access it and run the command.
However, I think it’d be much more elegant to have chef itself run the command on the target node, and prevent cross-ssh altogether. So, I’m looking into chef-provisioning and the
machine_execute resources it provides. But I’m kind of stuck at this point - if I simply depend on the gem in metadata.rb, and use those resources in my recipe, I get “
cannot load such file -- chef/provisioning” (the gem is installed on my workstation). And also, I barely can find any examples clarifying how to use this whole thing.
I’m relatively new to chef, so maybe I’m on completely wrong track with my approach.