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.
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*
Is there a chef
command that lists all the installed cookbooks along with their versions?
Try the following:
knife cookbook list | awk '{printf "knife cookbook show %s\n",$1}'| bash
Will print out the versions associated with each cookbook. For example:
java 1.31.0 1.29.0
mysql 6.0.22 6.0.21
rbac 1.0.3
smf 2.2.6
yum 3.6.0
yum-mysql-community 0.1.17
Variation on some of the above.
sudo grep -o -e '\"version\"\:\"[a-zA-Z0-9.]*\"' -e '\"version\"\: \"[a-zA-Z0-9.]*\"' /var/chef/cache/cookbooks/*/metadata.json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With