[英]Is it possible to access Chef in Ruby outside of a cookbook/recipe?
I am looking to have a ruby script on my Chef workstation that would use the Chef ruby gem and would be able to access data bags on its own, without being a cookbook or recipe. 我正在寻找一个Chef工作站上的ruby脚本,该脚本将使用Chef ruby gem,并能够独立访问数据包,而无需成为食谱或食谱。
Are you able to do this? 你能做到吗?
To add to Stephen's answer/comment, check out knife exec
for simple one-liners. 要添加到斯蒂芬的答案/评论中,请查看
knife exec
以获取简单的单线。 It is usually easier to get going than chef-api. 通常比Chef-api更容易上手。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.