Knife plugin for Chef to draw dependency graphs for roles that have become spaghetti.
Ruby 1.9.2 and higher.
This plugin requires on Graphviz, and should be installed prior to installing the plugin.
Graphviz may be obtained through a variety of methods. On OSX an easy method is via Homebrew:
$ brew install graphviz
Gem install, via RubyGems:
$ gem install knife-role-spaghetti
NOTE: Ensure that your
knife.rb has the
role_path setting configured.
Since this is a Knife plugin, execution should be performed in your Chef repository.
$ knife role spaghetti
with no arguments should result in a new file named
role-spaghetti.png in your
$ knife role spaghetti "/tmp/someotherfilename.png"
will place the file in the specified location.
knife role spaghetti -h for more options.
(full resolution here)
Running through the neato renderer (with the
-N switch) produces this image:
(full resolution here
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Test your changes (
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request
- Allows for better Chef version dependency management, thanks @patcon!
- Better Travis testing: more Chef versions, better timeout handling
- Locked down a bunch of gem dependencies
- Updated minimum required ruby to 1.9.2
- Fixed JSON roles loading #7 - Thanks @miah & @tezz!
- Re-implemented the DRY proposed by @jtimberman in #1, with a different method
- Prevent a role and recipe sharing the same name from colliding
- Figured out correct testing requirements matrix for Travis
- Added some more verbose logging options
- Updated CLI banner to reflect that filename is not required, renamed for clarity
- Improved handling cases where a role contains recipes named the same as the role
- Added handling for roles in JSON format
- Initial commit
Author:: Mike Fiedler (firstname.lastname@example.org) Copyright:: Copyright (c) 2012 Mike Fiedler License:: Apache License, Version 2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.