Class: BuckKnife::Commands::Create
- Inherits:
-
Struct
- Object
- Struct
- BuckKnife::Commands::Create
show all
- Includes:
- Base
- Defined in:
- lib/buckknife/commands/create.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Base
#base_run_list, #build_run_list, #to_s
Instance Attribute Details
#node ⇒ Object
Returns the value of attribute node
3
4
5
|
# File 'lib/buckknife/commands/create.rb', line 3
def node
@node
end
|
#project ⇒ Object
Returns the value of attribute project
3
4
5
|
# File 'lib/buckknife/commands/create.rb', line 3
def project
@project
end
|
Class Method Details
.[](provider) ⇒ Object
6
7
8
9
10
11
12
13
|
# File 'lib/buckknife/commands/create.rb', line 6
def self.[](provider)
case provider
when "rackspace" then RackspaceCreate
when "euca" then EucaCreate
else
raise ArgumentError, "Buckknife doesn't know how to create for this provider"
end
end
|
Instance Method Details
#chef_server_url ⇒ Object
36
37
38
|
# File 'lib/buckknife/commands/create.rb', line 36
def chef_server_url
Chef::Config[:chef_server_url]
end
|
#command ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/buckknife/commands/create.rb', line 15
def command
Command.new('knife').tap do |c|
c.arg project.provider, 'server', 'create'
c.opt '-r', base_run_list
c.opt '-f', flavor
c.opt '-I', image_id
c.opt '-d', project.distro
c.opt '-s', chef_server_url
c.opt '-N', node.name
c.opt '-x', project.ssh_username if project.ssh_username
end
end
|
#flavor ⇒ Object
32
33
34
|
# File 'lib/buckknife/commands/create.rb', line 32
def flavor
node.flavor
end
|
#image_id ⇒ Object
28
29
30
|
# File 'lib/buckknife/commands/create.rb', line 28
def image_id
node.image_id
end
|