Class: BuckKnife::Commands::Bootstrap

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

Overview

Takes a Project and Node instance Returns the knife command to bootstrap this server

NOTE: This does not add the roles and recipes of the node. This is because currently there are some dependency issues across nodes with some recipes. The current strategy is to add roles manually one by one running the chef client as needed.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Base

#base_run_list, #build_run_list, #to_s

Instance Attribute Details

#nodeObject

Returns the value of attribute node

Returns:

  • (Object)

    the current value of node



10
11
12
# File 'lib/buckknife/commands/bootstrap.rb', line 10

def node
  @node
end

#projectObject

Returns the value of attribute project

Returns:

  • (Object)

    the current value of project



10
11
12
# File 'lib/buckknife/commands/bootstrap.rb', line 10

def project
  @project
end

Instance Method Details

#commandObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/buckknife/commands/bootstrap.rb', line 13

def command
  super.tap do |c|
    c.arg 'bootstrap'
    c.arg node.address
    c.opt '-N', node.name
    c.opt '-x', node.ssh_username
    c.opt '-P', node.ssh_password
    c.opt '-r', base_run_list
    c.opt '-d', project.distro
    c.opt '--sudo'
  end
end