Permalink
Browse files

First commit to my repo; renamed knife-audit

  • Loading branch information...
1 parent 67b4ce9 commit f8c617d9207446ae97b190466133d9508c48f11c J.B. Zimmerman committed Aug 31, 2011
View
@@ -1,4 +1,4 @@
source "http://rubygems.org"
-# Specify your gem's dependencies in knife-flow.gemspec
+# Specify your gem's dependencies in knife-audit.gemspec
gemspec
View
@@ -1,24 +1,24 @@
-knife-survey
+knife-audit
========
A Chef plugin for determining which cookbooks are in use on which nodes of your Chef server or Opscode organization.
Allows you to safely maintain a chef cookbook set by determining which cookbooks are currently in use by nodes (included in node runlists).
Requirements
---------------
-Installing knife-survey
+Installing knife-audit
-------------------
Be sure you are running the latest version of Chef.
- gem install knife-flow
+ gem install knife-audit
Plugins
---------------
-### survey
+### audit
- knife survey <COOKBOOK COOKBOOK ...>
+ knife audit <COOKBOOK COOKBOOK ...>
@@ -1,17 +1,17 @@
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
-require "knife-survey/version"
+require "knife-audit/version"
Gem::Specification.new do |s|
- s.name = "knife-survey"
- s.version = Knife::Survey::VERSION
+ s.name = "knife-audit"
+ s.version = Knife::Audit::VERSION
s.authors = ["Jacob Zimmerman"]
s.email = ["jzimmerman@mdsol.com"]
s.homepage = "https://github.com/mdsol/knife-survey"
s.summary = %q{A Chef plugin for determining which cookbooks are in use on which nodes of your Chef server or Opscode organization.}
s.description = %q{Allows you to safely maintain a chef cookbook set by determining which cookbooks are currently in use by nodes (included in node runlists).}
- s.rubyforge_project = "knife-survey"
+ s.rubyforge_project = "knife-audit"
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -75,18 +75,17 @@ def run
Shef::Extensions.extend_context_object(self)
node_list = nodes.find(query)
- # using expand!.recipes catches multi-level roles (roles with roles with recipes, etc.)
- recipes = node_list.first.expand!.recipes.to_a
- node_cookbook_list = recipes.map{ |x| x.match(/[^\:]+/)[0] }.uniq
-
- puts node_cookbook_list.inspect
-
# 3) Iterate over each node
-# node_list.each do |node|
+ node_list.each do |node|
# 3a) Get node's runlist
-# recipes = node.expand!.recipes
+
+ # using expand!.recipes catches multi-level roles (roles with roles with recipes, etc.)
+ recipes = node.expand!.recipes.to_a
+ node_cookbook_list = recipes.map{ |x| x.match(/[^\:]+/)[0] }.uniq
+
+ puts node_cookbook_list.inspect
# 3b) Add the cookbooks/recipes in node's runlist to the node array's 'runlist' hash
File renamed without changes.

0 comments on commit f8c617d

Please sign in to comment.