是否可以在 cookbook/recipe 之外访问 Ruby 中的 Chef?

Is it possible to access Chef in Ruby outside of a cookbook/recipe?

我希望在我的 Chef 工作站上有一个 ruby 脚本,它将使用 Chef ruby gem 并且能够自行访问数据包,而无需食谱或食谱。

你能做到吗?

要添加到 Stephen 的 answer/comment,请查看 knife exec 以获取简单的一行。通常比 chef-api.

更容易上手

存在多个 API 客户端,包括 chef-api and ridley 应该允许您访问数据包。