Sha256: cd2520c6f02b19f3506837b1a92633dd157d653e224761fc956d43a003da9cb6

Contents?: true

Size: 662 Bytes

Versions: 1

Compression:

Stored size: 662 Bytes

Contents

module KnifeDraw
  class DrawRoles < Chef::Knife
    deps do
      require 'graphviz'
    end

    banner "knife draw roles"

    def run
      graph = ChefGraph.new
      source = ChefServerSource.new
      source.roles.each do |role_name, role|
        ui.msg "name: #{role_name}"
        role_box = graph.draw_role(role_name)
        source.runlist_for_role(role_name).each do |run_list|
          runlist_box = graph.draw_runlist run_list.to_s
          graph.connect(role_box, runlist_box)
          ui.msg "\t\trunlist: #{run_list}"
        end
      end
      graph.draw!
    end
  end

  class RoleDraw < DrawRoles
    banner "knife role draw"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
knife-draw-0.9.0 lib/knife_draw/draw_roles.rb