-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy /tmp/kitchen/nodes back to workstation nodes dir after converge #36
Comments
I have not been using test-kitchen and chef lately and have not been actively developing this plugin. One weakness with this plugin is that it captures the state of a node prior to converge but as you have noted, does not persist state post converge. Definitely open to PRs if you wanted to investigate ea solution. |
it looks like the way to do this would be:
I might give this a try if I get time. |
test-kitchen/test-kitchen#1306 will make this work. if that gets merged I think there could be some updates to kitchen-nodes:
|
What's the status of this suggestion? I'm having the same issue with kitchen-nodes: normal attributes of the nodes always get overwritten. It would be nice to have those preserved. |
if youre running into the same issue I was - that the node file is deleted and recreated with only a few attributes at the start of the node's converge - then this patch will fix your problem: require 'kitchen'
require 'kitchen/provisioner/chef_zero'
module Kitchen
module Provisioner
# Patch kitchen-nodes to not delete node files before converge. This
# ensures all node files will be uploaded during concurrent provisions.
# https://github.com/mwrock/kitchen-nodes/blob/master/lib/kitchen/provisioner/nodes.rb
class Nodes < ChefZero
def create_sandbox
create_node
ensure
super
end
end
end
end That needs to be loaded when you run It would be a good idea to make this change in this gem - but I have not submitted a pr for it. it probably needs to be configurable whether or not the node file is deleted at the start of the node's converge. |
FWIW, #node_template should merge the normal attributes from the already existing node file, if anything. This would make sure that other, updated nodes' info also get their way into the index. |
Right now this doesnt seem to bring back the converged node attributes to the nodes directory on the workstation. For example, if you converge a node with an environment, environment attributes are written to the node json file on the instance (
/tmp/kitchen/nodes/my-node.json
). But the attributes are not written back to the node json file on the workstation (test/fixtures/nodes/my-node.json
). The purpose of this would be to then search for the nodes that have attributes from an environment or that were set during a chef-client converge.Is there a way to copy
/tmp/kitchen/nodes
from the instance back to the workstation nodes dir after converge?Seems this could be done with data bags as well, some recipes create data bag items for recipes on other nodes to consume.
The text was updated successfully, but these errors were encountered: