Class: BuckKnife::ProjectAddRole

Inherits:
Chef::Knife
  • Object
show all
Defined in:
lib/chef/knife/project_add_role.rb

Instance Method Summary collapse

Instance Method Details

#runObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/chef/knife/project_add_role.rb', line 12

def run
  project   = project_from_arg_or_ask
  node_name = @name_args[1]
  nodes     = Array(project.node(node_name) || project.nodes)

  nodes.each do |node|
    ui.output "# Run these command to add roles one at a time to #{node.name}:"
    ui.output BuckKnife::Commands::AddRole.new( node )
  end
end