Skip to content

Commit

Permalink
[KNIFE_RACKSPACE-30] Make use of --json-attributes option for knife b…
Browse files Browse the repository at this point in the history
…ootstrap.
  • Loading branch information
stormsilver authored and stevendanna committed May 15, 2012
1 parent 02ab243 commit bc5832f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/chef/knife/rackspace_server_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ class RackspaceServerCreate < Knife
:description => "Comma separated list of roles/recipes to apply",
:proc => lambda { |o| o.split(/[\s,]+/) },
:default => []

option :first_boot_attributes,
:short => "-j JSON_ATTRIBS",
:long => "--json-attributes",
:description => "A JSON string to be added to the first run of chef-client",
:proc => lambda { |o| JSON.parse(o) },
:default => {}

option :rackspace_metadata,
:short => "-M JSON",
Expand Down Expand Up @@ -192,6 +199,7 @@ def bootstrap_for_node(server)
bootstrap = Chef::Knife::Bootstrap.new
bootstrap.name_args = [public_dns_name(server)]
bootstrap.config[:run_list] = config[:run_list]
bootstrap.config[:first_boot_attributes] = config[:first_boot_attributes]
bootstrap.config[:ssh_user] = config[:ssh_user] || "root"
bootstrap.config[:ssh_password] = server.password
bootstrap.config[:identity_file] = config[:identity_file]
Expand Down

0 comments on commit bc5832f

Please sign in to comment.