stemcell 0.6.4 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stemcell (0.6.4)
4
+ stemcell (0.7.0)
5
5
  aws-creds (~> 0.2.2)
6
6
  aws-sdk (~> 1.9)
7
7
  chef (~> 11.4.0)
@@ -64,6 +64,7 @@ module Stemcell
64
64
  puts "\nYou're about to launch instance(s) with the following options:\n\n"
65
65
 
66
66
  options.keys.sort.each do |key|
67
+ next if key == "aws_secret_key"
67
68
  value = options[key]
68
69
  next unless value
69
70
  spaces = " " * (23 - key.length)
@@ -27,7 +27,8 @@ module Stemcell
27
27
  # This method will return nil if the role has no stemcell metdata.
28
28
  def metadata_for_role(chef_role, chef_environment)
29
29
  default_attrs, override_attrs = expand_role(chef_role, chef_environment)
30
- merged_attrs = deep_merge!(override_attrs, default_attrs)
30
+ # hash_only_merge is how chef combines override_attrs and default_attrs so that overrides "win"
31
+ merged_attrs = hash_only_merge!(default_attrs, override_attrs)
31
32
  METADATA_ATTRIBUTES.inject(nil) { |r, key| r || merged_attrs[key] }
32
33
  end
33
34
 
@@ -32,7 +32,8 @@ module Stemcell
32
32
  :name => 'aws_secret_key',
33
33
  :desc => "aws secret key",
34
34
  :type => String,
35
- :env => 'AWS_SECRET_KEY'
35
+ :env => 'AWS_SECRET_KEY',
36
+ :hide => true
36
37
  },
37
38
  {
38
39
  :name => 'region',
@@ -221,7 +222,11 @@ module Stemcell
221
222
 
222
223
  _defns.each do |defn|
223
224
  # Prioritize the environment variable, then the given default
224
- default = ENV[defn[:env]] || _this.defaults[defn[:name]]
225
+ if defn[:hide]
226
+ default = "<hidden>"
227
+ else
228
+ default = ENV[defn[:env]] || _this.defaults[defn[:name]]
229
+ end
225
230
 
226
231
  opt(
227
232
  defn[:name],
@@ -235,6 +240,13 @@ module Stemcell
235
240
  opt('help', 'help', :short => :l) if _this.override_help
236
241
  end
237
242
 
243
+ # Populate the hidden defaults. Some (like aws secret key) is :hidden so that Trollop wont print that into stdout
244
+ _defns.each do |defn|
245
+ if defn[:hide] && options[defn[:name]] == "<hidden>"
246
+ options[defn[:name]] = ENV[defn[:env]] || _this.defaults[defn[:name]]
247
+ end
248
+ end
249
+
238
250
  # convert tags from string to ruby hash
239
251
  if options['tags']
240
252
  tags = {}
@@ -41,7 +41,6 @@ data_bag_secret='<%= opts["chef_data_bag_secret"] %>'
41
41
  hostname='<%= opts['instance_hostname'] %>'
42
42
  domain_name='<%= opts['instance_domain_name'] %>'
43
43
  chef_version='<%= opts['chef_version'] %>'
44
- package_url="<%= opts['chef_package_source'] %>"
45
44
 
46
45
 
47
46
  ##
@@ -91,6 +90,7 @@ install_chef() {
91
90
  platform_version=`lsb_release -s -r`
92
91
  arch=`uname -m`
93
92
  package_local="/tmp/chef_${chef_version}.deb"
93
+ package_url="<%= opts['chef_package_source'] %>"
94
94
  echo "Downloading chef from $package_url"
95
95
  wget $package_url -O $package_local
96
96
  echo "Installing chef $chef_version"
@@ -1,3 +1,3 @@
1
1
  module Stemcell
2
- VERSION = "0.6.4"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -2,8 +2,6 @@
2
2
  "instance_type": "m3.xlarge",
3
3
  "security_groups": [
4
4
  "all",
5
- "base",
6
- "default",
7
5
  "override"
8
6
  ],
9
7
  "tags": {
@@ -2,7 +2,6 @@
2
2
  "instance_type": "m3.xlarge",
3
3
  "security_groups": [
4
4
  "all",
5
- "base",
6
5
  "override"
7
6
  ],
8
7
  "tags": {
@@ -1,8 +1,6 @@
1
1
  {
2
2
  "instance_type": "m3.xlarge",
3
3
  "security_groups": [
4
- "all",
5
- "default",
6
4
  "override"
7
5
  ],
8
6
  "tags": {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stemcell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-01-09 00:00:00.000000000 Z
15
+ date: 2014-01-31 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: aws-sdk