Class: BuckKnife::Commands::RunClient

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/buckknife/commands/run_client.rb

Overview

options is a hash with one or more of the following keys specified: :project => Project Name eg. myapp :environment => Environment Name eg. staging :node => Node Name eg. myapp-staging-app1 :ssh_user => (optional) ssh user to connect with :ssh_password => (optional) ssh user’s password

Instance Method Summary collapse

Methods included from Base

#base_run_list, #build_run_list, #to_s

Constructor Details

#initialize(options) ⇒ RunClient

Returns a new instance of RunClient.



12
13
14
15
# File 'lib/buckknife/commands/run_client.rb', line 12

def initialize(options)
  @project = BuckKnife::Project.find( options[:project] )
  @options = options
end

Instance Method Details

#commandObject



17
18
19
20
21
22
23
24
# File 'lib/buckknife/commands/run_client.rb', line 17

def command
  super.tap do |c|
    c.arg 'ssh', query, 'sudo chef-client'
    c.opt '--attribute', 'ipaddress'
    c.opt '-x', ssh_username
    c.opt '-P', ssh_password
  end
end