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 +1 -1
- data/lib/stemcell/metadata_launcher.rb +1 -0
- data/lib/stemcell/metadata_source/chef_repository.rb +2 -1
- data/lib/stemcell/option_parser.rb +14 -2
- data/lib/stemcell/templates/bootstrap.sh.erb +1 -1
- data/lib/stemcell/version.rb +1 -1
- data/spec/fixtures/chef_repo/roles-expected-metadata/unit-inherit-both.json +0 -2
- data/spec/fixtures/chef_repo/roles-expected-metadata/unit-inherit-override.json +0 -1
- data/spec/fixtures/chef_repo/roles-expected-metadata/unit-simple-both.json +0 -2
- metadata +2 -2
data/Gemfile.lock
CHANGED
@@ -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
|
-
|
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
|
-
|
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"
|
data/lib/stemcell/version.rb
CHANGED
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.
|
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-
|
15
|
+
date: 2014-01-31 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: aws-sdk
|