Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

[KNIFE_RACKSPACE-30] Make use of --json-attributes option for knife bootstrap #19

Closed
wants to merge 4 commits into from

3 participants

Eric Hankins Steven Danna Matt Ray
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 8 additions and 0 deletions. Show diff stats Hide diff stats

  1. 8  lib/chef/knife/rackspace_server_create.rb
8  lib/chef/knife/rackspace_server_create.rb
@@ -101,6 +101,13 @@ class RackspaceServerCreate < Knife
101 101
         :description => "Comma separated list of roles/recipes to apply",
102 102
         :proc => lambda { |o| o.split(/[\s,]+/) },
103 103
         :default => []
  104
+        
  105
+      option :first_boot_attributes,
  106
+        :short => "-j JSON_ATTRIBS",
  107
+        :long => "--json-attributes",
  108
+        :description => "A JSON string to be added to the first run of chef-client",
  109
+        :proc => lambda { |o| JSON.parse(o) },
  110
+        :default => {}
104 111
 
105 112
       option :rackspace_metadata,
106 113
         :short => "-M JSON",
@@ -192,6 +199,7 @@ def bootstrap_for_node(server)
192 199
         bootstrap = Chef::Knife::Bootstrap.new
193 200
         bootstrap.name_args = [public_dns_name(server)]
194 201
         bootstrap.config[:run_list] = config[:run_list]
  202
+        bootstrap.config[:first_boot_attributes] = config[:first_boot_attributes]
195 203
         bootstrap.config[:ssh_user] = config[:ssh_user] || "root"
196 204
         bootstrap.config[:ssh_password] = server.password
197 205
         bootstrap.config[:identity_file] = config[:identity_file]
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.