0.03
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
knife-inspect is a knife plugin to compare the content of your Chef repository and Chef server
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.8
~> 11.2
~> 3.5.0
~> 0.12

Runtime

>= 11.0.0
~> 0.0.2
~> 1.3
 Project Readme

Gem Version Build Status Code Climate Coverage Status

Summary

knife-inspect is a knife plugin that inspects your chef repo as it compares to what is on your chef server. You can inspect your entire repo, or individual components.

Usage

$ gem install knife-inspect
$ cd [chef repo]

Knife Commands

knife inspect

knife cookbook inspect [--no-cookbooks --no-data-bags --no-data-bag-items --no-environments --no-roles]
knife cookbook inspect [COOKBOOK]

knife data bag inspect
knife data bag inspect [BAG]
knife data bag inspect [BAG] [ITEM]

knife environment inspect
knife environment inspect [ENVIRONMENT]

knife role inspect
knife role inspect [ROLE]

What it does

So far it checks if...

  • your cookbooks are in sync
  • you have uncommitted changes in a cookbook (assuming your cookbooks are in their own git repos)
  • you have commits in a cookbook that haven't been pushed to your remote (assuming your cookbooks are in their own git repos)
  • your data bags are in sync
  • your data bag items are in sync
  • your environments are in sync
  • your roles are in sync

You can use the option switches to disable checking for a resource type when running knife inspect:

  • --no-cookbooks
  • --no-data-bags
  • --no-data-bag-items
  • --no-environments
  • --no-roles

You can use it with your favorite Continuous Integration tool, it returns 0 when everything is in sync or 1 if it's not.

Frequently Asked Questions

How is it different from knife diff?

  • It returns the proper return code, so you can use it with a Continuous Integration tool
  • knife diff seems to expect local roles to be json files, knife-inspect supports both JSON and Ruby.
  • It's my personal opinion, but I think the output from knife-inspect is more readable. Also I don't understand some of the errors I'm getting with knife diff (Only in .: clients for example)
  • I actually didn't know there was a built-in knife diff command.

Compatibility

This gem is tested with Ruby 2.3 and has been tested with Chef 13, 12 and 11.

Contributors

(in alphabetical order)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Do not bump the version number
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request