获取已安装食谱的列表及其版本 [英] Get list of installed cookbooks along with their version
本文介绍了获取已安装食谱的列表及其版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个通过Chef调配的服务器。现在,我想确切地知道此服务器上已安装了哪些烹饪书版本。
I have a server that has been provisioned via chef. Now I like to know exactly which cookbook versions have been installed on this server.
作为新手厨师,我尝试使用 grep
类似于以下内容,但我想知道是否存在某种获取信息的官方方法。
Being a chef-newbee, I worked around using grep
like the following, but I like to know whether or not there is some official way of getting that information.
sudo grep -E '^version|"version":' /var/chef/cache/cookbooks/*/metadata*
是否有 chef
命令列出所有已安装的食谱及其版本?
Is there a chef
command that lists all the installed cookbooks along with their versions?
推荐答案
上面某些内容的变化。
sudo grep -o -e '\"version\"\:\"[a-zA-Z0-9.]*\"' -e '\"version\"\: \"[a-zA-Z0-9.]*\"' /var/chef/cache/cookbooks/*/metadata.json
这篇关于获取已安装食谱的列表及其版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文