From bc5832f1de8aca59350d9f1e937e075623d5d012 Mon Sep 17 00:00:00 2001 From: Eric Hankins Date: Tue, 10 Apr 2012 14:06:02 -0500 Subject: [PATCH 1/2] [KNIFE_RACKSPACE-30] Make use of --json-attributes option for knife bootstrap. --- lib/chef/knife/rackspace_server_create.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/chef/knife/rackspace_server_create.rb b/lib/chef/knife/rackspace_server_create.rb index 314df16..6c1be49 100644 --- a/lib/chef/knife/rackspace_server_create.rb +++ b/lib/chef/knife/rackspace_server_create.rb @@ -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", @@ -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] From 282697f23020046e853b01ce594be445c61481b0 Mon Sep 17 00:00:00 2001 From: Steven Danna Date: Tue, 15 May 2012 10:50:24 -0700 Subject: [PATCH 2/2] Update Changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 655d0cd..da47179 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ * updated for rackspace_api_username and the correct current image number for Ubuntu 10.04 LTS * KNIFE-RACKSPACE-26 fog doesn't provide cores enumeration anymore * updated copyright and removed trailing comma +* KNIFE_RACKSPACE-30 Make use of --json-attributes option for knife + bootstrap. ## v0.5.12 * remove dependency on net-ssh and net-ssh-multi..neither is access directly in plugin