knife-rackspace 0.5.3 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -27,7 +27,7 @@ If your knife.rb file will be checked into a SCM system (ie readable by others)
27
27
  You also have the option of passing your Rackspace API Username/Key into the individual knife subcommands using the <tt>-A</tt> (or <tt>--rackspace-api-username</tt>) <tt>-K</tt> (or <tt>--rackspace-api-key</tt>) command options
28
28
 
29
29
  # provision a new 1GB Ubuntu 10.04 webserver
30
- knife rackspace server create 'role[webserver]' -i 49 -f 3 -A 'Your Rackspace API username' -K "Your Rackspace API Key"
30
+ knife rackspace server create 'role[webserver]' -I 49 -f 3 -A 'Your Rackspace API username' -K "Your Rackspace API Key"
31
31
 
32
32
  This plugin also has support for authenticating against an alternate API Auth URL. This is useful if you are a Rackspace Cloud UK user or OpenStack early adopter. Here is an example of configuring knife for Rackspace Cloud UK:
33
33
 
@@ -90,6 +90,11 @@ class Chef
90
90
  :long => "--prerelease",
91
91
  :description => "Install the pre-release chef gems"
92
92
 
93
+ option :bootstrap_version,
94
+ :long => "--bootstrap-version VERSION",
95
+ :description => "The version of Chef to install",
96
+ :proc => Proc.new { |v| Chef::Config[:knife][:bootstrap_version] = v }
97
+
93
98
  option :distro,
94
99
  :short => "-d DISTRO",
95
100
  :long => "--distro DISTRO",
@@ -135,7 +140,6 @@ class Chef
135
140
  end
136
141
 
137
142
  def run
138
-
139
143
  $stdout.sync = true
140
144
 
141
145
  connection = Fog::Compute.new(
@@ -185,6 +189,7 @@ class Chef
185
189
  puts "#{ui.color("Public IP Address", :cyan)}: #{server.addresses["public"][0]}"
186
190
  puts "#{ui.color("Private IP Address", :cyan)}: #{server.addresses["private"][0]}"
187
191
  puts "#{ui.color("Password", :cyan)}: #{server.password}"
192
+ puts "#{ui.color("Environment", :cyan)}: #{config[:environment] || '_default'}"
188
193
  puts "#{ui.color("Run List", :cyan)}: #{config[:run_list].join(', ')}"
189
194
  end
190
195
 
@@ -197,14 +202,20 @@ class Chef
197
202
  bootstrap.config[:identity_file] = config[:identity_file]
198
203
  bootstrap.config[:chef_node_name] = config[:chef_node_name] || server.id
199
204
  bootstrap.config[:prerelease] = config[:prerelease]
200
- bootstrap.config[:distro] = Chef::Config[:knife][:distro] || config[:distro]
205
+ bootstrap.config[:bootstrap_version] = locate_config_value(:bootstrap_version)
206
+ bootstrap.config[:distro] = locate_config_value(:distro)
201
207
  # bootstrap will run as root...sudo (by default) also messes up Ohai on CentOS boxes
202
208
  bootstrap.config[:use_sudo] = config[:use_sudo]
203
- bootstrap.config[:template_file] = Chef::Config[:knife][:template_file] || config[:template_file]
209
+ bootstrap.config[:template_file] = locate_config_value(:template_file)
204
210
  bootstrap.config[:environment] = config[:environment]
205
211
  bootstrap
206
212
  end
207
213
 
214
+ def locate_config_value(key)
215
+ key = key.to_sym
216
+ Chef::Config[:knife][key] || config[key]
217
+ end
218
+
208
219
  def public_dns_name(server)
209
220
  @public_dns_name ||= begin
210
221
  Resolv.getname(server.addresses["public"][0])
@@ -1,3 +1,3 @@
1
1
  module KnifeRackspace
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: knife-rackspace
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.3
5
+ version: 0.5.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Adam Jacob
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-06 00:00:00 -04:00
13
+ date: 2011-05-02 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency