简体   繁体   中英

how can i download the cookbook from the node directly from the chef server without interfering the workstation?

It is working when I bootstrap the node from the workstation to through the chef -server.but the case is I want to download the cookbook from the node directly from the chef server without interfering the workstation. Because the attribute file want to be change from the node. Can someone suggest me the right solution or any reference link?

It's hard to tell with the language barrier but I think you're asking how to upload a cookbook from a node? Something about you're trying to make a self-modifying cookbook? If so, we don't really support that. You could modify the server ACLs to allow it but we would strongly recommend against it as it becomes a security problem. If you really do mean "download", nodes always download cookbooks (and everything else) from the Chef Server, the workstation is only used to upload things so they can be accessed later.

"The downloading to node" part can be easily achieved as chef-client will download the cookbook(s) as a part of the run to cache directory ( /var/chef/cache/cookbooks by default on Linux nodes).

Not sure why you would like to download the cookbook to node and edit the attributes, though you may be able to achieve this with:

chef-client --why-run

Note: You can do chef-client -o cookbook_name --why-run if the cookbook is not a part of node run_list.

This will simulate a chef client run without changing anything on the node, however the cookbook will be available in the cache directory mentioned above. You can make any local changes, but cannot make chef-client pick up the local changes.

I don't have much experience with chef-solo , though I have seen that it can be used with locally available cookbooks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM