stemcell 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ Yjk5MmIxNTA2OTg1ZTI1YzVlOTc5NTM3ODFiMjlmNzNmNjdkMjJhMQ==
5
+ data.tar.gz: !binary |-
6
+ ZDVkYmQ1YzViMzJlNjhmZDBlNGM2YTVmYTZmNjFmM2U3N2VhYjdhZQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ YTU1M2YxOGEzNGFmZjE5YmE4NjZkNzk3Mjg4OTIxMGFjZWIwOGI1MTBmYmY0
10
+ YjdkYWIzNTBkMzY3N2E1ZjE1ZTVlY2U3MjJjODJmNjg1ZGQxMGMyOTYwOGRk
11
+ ZGQ1OWI2ZDI1ZGY4OTM1MjkwZTlkMDhkOWIyZTE3OTU4NGU4ZTc=
12
+ data.tar.gz: !binary |-
13
+ MDYwMzllODg3OTYxN2I5NGE1MWE3ZWE4ODliN2NiMmJkMGM4YjBlZGQ2ZDVm
14
+ MTU0ZjQwZGQ0NjNjNTNhMWRjN2Y1ZDM2M2IyNDdkNWU4NDdmYjJhOGZjNWI5
15
+ YTk1MDYyZjUyZjVkOWJhMDBjMGQ5ODA4MTBlYmQxYTgwMTJhNGI=
data/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+
2
+ # next release
3
+ - ...
4
+
5
+ # 0.8.0
6
+ - Support for VPC [Brenden](https://github.com/brndnmtthws)
7
+ - Support relative paths and home alias in `Launcher#try_file` [Patrick Viet](https://github.com/patrickviet)
8
+ - Add Ohai hint for EC2 [sandstrom](https://github.com/sandstrom)
9
+ - Less verbose download progress for chef [sandstrom](https://github.com/sandstrom)
10
+
11
+ # 0.7.1
12
+ - relax version constraint on Chef gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stemcell (0.7.1)
4
+ stemcell (0.8.0)
5
5
  aws-creds (~> 0.2.2)
6
6
  aws-sdk (~> 1.9)
7
7
  chef (>= 11.4.0)
@@ -15,15 +15,15 @@ GEM
15
15
  specs:
16
16
  aws-creds (0.2.3)
17
17
  trollop (~> 2.0)
18
- aws-sdk (1.48.1)
18
+ aws-sdk (1.51.0)
19
19
  json (~> 1.4)
20
20
  nokogiri (>= 1.4.4)
21
- chef (11.12.8)
22
- chef-zero (>= 2.0.2, < 2.1)
21
+ chef (11.14.6)
22
+ chef-zero (~> 2.1, >= 2.1.4)
23
23
  diff-lcs (~> 1.2, >= 1.2.4)
24
24
  erubis (~> 2.7)
25
+ ffi-yajl (~> 1.0)
25
26
  highline (~> 1.6, >= 1.6.9)
26
- json (>= 1.4.4, <= 1.8.1)
27
27
  mime-types (~> 1.16)
28
28
  mixlib-authentication (~> 1.3)
29
29
  mixlib-cli (~> 1.4)
@@ -32,11 +32,11 @@ GEM
32
32
  mixlib-shellout (~> 1.4)
33
33
  net-ssh (~> 2.6)
34
34
  net-ssh-multi (~> 1.1)
35
- ohai (~> 7.0.4)
35
+ ohai (~> 7.2)
36
+ plist (~> 3.1.0)
36
37
  pry (~> 0.9)
37
- rest-client (>= 1.0.4, < 1.7.0)
38
- yajl-ruby (~> 1.1)
39
- chef-zero (2.0.2)
38
+ rest-client (>= 1.0.4, <= 1.6.7)
39
+ chef-zero (2.2)
40
40
  hashie (~> 2.0)
41
41
  json
42
42
  mixlib-log (~> 1.3)
@@ -46,10 +46,15 @@ GEM
46
46
  diff-lcs (1.2.5)
47
47
  docile (1.1.5)
48
48
  erubis (2.7.0)
49
+ ffi (1.9.3)
50
+ ffi-yajl (1.0.2)
51
+ ffi (~> 1.5)
52
+ libyajl2 (~> 1.0)
49
53
  hashie (2.1.2)
50
54
  highline (1.6.21)
51
55
  ipaddress (0.8.0)
52
56
  json (1.7.7)
57
+ libyajl2 (1.0.1)
53
58
  method_source (0.8.2)
54
59
  mime-types (1.25.1)
55
60
  mini_portile (0.6.0)
@@ -66,28 +71,28 @@ GEM
66
71
  net-ssh-multi (1.2.0)
67
72
  net-ssh (>= 2.6.5)
68
73
  net-ssh-gateway (>= 1.2.0)
69
- nokogiri (1.6.2.1)
74
+ nokogiri (1.6.3.1)
70
75
  mini_portile (= 0.6.0)
71
- ohai (7.0.4)
76
+ ohai (7.2.4)
77
+ ffi (~> 1.9)
78
+ ffi-yajl (~> 1.0)
72
79
  ipaddress
73
80
  mime-types (~> 1.16)
74
81
  mixlib-cli
75
82
  mixlib-config (~> 2.0)
76
83
  mixlib-log
77
84
  mixlib-shellout (~> 1.2)
78
- systemu (~> 2.5.2)
79
- yajl-ruby
80
- pry (0.10.0)
85
+ systemu (~> 2.6.4)
86
+ wmi-lite (~> 1.0)
87
+ plist (3.1.0)
88
+ pry (0.10.1)
81
89
  coderay (~> 1.1.0)
82
90
  method_source (~> 0.8.1)
83
91
  slop (~> 3.4)
84
92
  rack (1.5.2)
85
93
  rake (10.3.2)
86
- rdoc (4.1.1)
87
- json (~> 1.4)
88
- rest-client (1.6.8)
89
- mime-types (~> 1.16)
90
- rdoc (>= 2.4.2)
94
+ rest-client (1.6.7)
95
+ mime-types (>= 1.16)
91
96
  rspec (2.14.1)
92
97
  rspec-core (~> 2.14.0)
93
98
  rspec-expectations (~> 2.14.0)
@@ -104,9 +109,9 @@ GEM
104
109
  simplecov-html (~> 0.8.0)
105
110
  simplecov-html (0.8.0)
106
111
  slop (3.6.0)
107
- systemu (2.5.2)
112
+ systemu (2.6.4)
108
113
  trollop (2.0)
109
- yajl-ruby (1.2.1)
114
+ wmi-lite (1.0.0)
110
115
 
111
116
  PLATFORMS
112
117
  ruby
@@ -24,7 +24,6 @@ module Stemcell
24
24
  'key_name',
25
25
  'instance_type',
26
26
  'image_id',
27
- 'security_groups',
28
27
  'availability_zone',
29
28
  'count'
30
29
  ]
@@ -44,8 +43,14 @@ module Stemcell
44
43
  'instance_domain_name',
45
44
  'image_id',
46
45
  'availability_zone',
46
+ 'vpc_id',
47
+ 'subnet',
48
+ 'private_ip_address',
49
+ 'dedicated_tenancy',
50
+ 'associate_public_ip_address',
47
51
  'count',
48
52
  'security_groups',
53
+ 'security_group_ids',
49
54
  'tags',
50
55
  'iam_role',
51
56
  'ebs_optimized',
@@ -76,7 +81,12 @@ module Stemcell
76
81
  :access_key_id => @aws_access_key,
77
82
  :secret_access_key => @aws_secret_key})
78
83
 
79
- @ec2 = AWS::EC2.new(:ec2_endpoint => @ec2_url)
84
+ if opts['vpc_id']
85
+ puts 'using vpc tho'
86
+ @ec2 = AWS::VPC.new(opts['vpc_id'], :ec2_endpoint => @ec2_url)
87
+ else
88
+ @ec2 = AWS::EC2.new(:ec2_endpoint => @ec2_url)
89
+ end
80
90
  end
81
91
 
82
92
 
@@ -101,17 +111,40 @@ module Stemcell
101
111
  # generate launch options
102
112
  launch_options = {
103
113
  :image_id => opts['image_id'],
104
- :security_groups => opts['security_groups'],
105
114
  :instance_type => opts['instance_type'],
106
115
  :key_name => opts['key_name'],
107
116
  :count => opts['count'],
108
117
  }
109
118
 
119
+ if opts['security_groups'] && !opts['security_groups'].empty?
120
+ launch_options[:security_groups] = opts['security_groups']
121
+ end
122
+
123
+ if opts['security_group_ids'] && !opts['security_group_ids'].empty?
124
+ launch_options[:security_group_ids] = opts['security_group_ids']
125
+ end
126
+
110
127
  # specify availability zone (optional)
111
128
  if opts['availability_zone']
112
129
  launch_options[:availability_zone] = opts['availability_zone']
113
130
  end
114
131
 
132
+ if opts['subnet']
133
+ launch_options[:subnet] = opts['subnet']
134
+ end
135
+
136
+ if opts['private_ip_address']
137
+ launch_options[:private_ip_address] = opts['private_ip_address']
138
+ end
139
+
140
+ if opts['dedicated_tenancy']
141
+ launch_options[:dedicated_tenancy] = opts['dedicated_tenancy']
142
+ end
143
+
144
+ if opts['associate_public_ip_address']
145
+ launch_options[:associate_public_ip_address] = opts['associate_public_ip_address']
146
+ end
147
+
115
148
  # specify IAM role (optional)
116
149
  if opts['iam_role']
117
150
  launch_options[:iam_instance_profile] = opts['iam_role']
@@ -255,11 +288,7 @@ module Stemcell
255
288
 
256
289
  # attempt to accept keys as file paths
257
290
  def try_file(opt="")
258
- begin
259
- return File.read(opt)
260
- rescue Object => e
261
- return opt
262
- end
291
+ File.read(File.expand_path(opt)) rescue opt
263
292
  end
264
293
 
265
294
  end
@@ -67,7 +67,7 @@ module Stemcell
67
67
  next if key == "aws_secret_key"
68
68
  value = options[key]
69
69
  next unless value
70
- spaces = " " * (23 - key.length)
70
+ spaces = " " * (30 - key.length)
71
71
  puts " #{key}#{spaces}#{value.to_s.green}"
72
72
  end
73
73
 
@@ -65,12 +65,48 @@ module Stemcell
65
65
  :type => String,
66
66
  :env => 'SECURITY_GROUPS'
67
67
  },
68
+ {
69
+ :name => 'security_group_ids',
70
+ :desc => "comma-separated list of security group IDs to launch instance with",
71
+ :type => String,
72
+ :env => 'SECURITY_GROUP_IDS'
73
+ },
68
74
  {
69
75
  :name => 'availability_zone',
70
76
  :desc => "zone in which to launch instances",
71
77
  :type => String,
72
78
  :env => 'AVAILABILITY_ZONE'
73
79
  },
80
+ {
81
+ :name => 'vpc_id',
82
+ :desc => "VPC ID for which to launch this instance",
83
+ :type => String,
84
+ :env => 'VPC_ID'
85
+ },
86
+ {
87
+ :name => 'subnet',
88
+ :desc => "VPC subnet for which to launch this instance",
89
+ :type => String,
90
+ :env => 'SUBNET'
91
+ },
92
+ {
93
+ :name => 'private_ip_address',
94
+ :desc => "VPC private IP to use",
95
+ :type => String,
96
+ :env => 'PRIVATE_IP_ADDRESS'
97
+ },
98
+ {
99
+ :name => 'dedicated_tenancy',
100
+ :desc => "Enable dedicated tenancy",
101
+ :env => 'DEDICATED_TENANCY',
102
+ :default => false,
103
+ },
104
+ {
105
+ :name => 'associate_public_ip_address',
106
+ :desc => "Associate public IP address (for VPC)",
107
+ :env => 'ASSOCIATE_PUBLIC_IP_ADDRESS',
108
+ :default => false,
109
+ },
74
110
  {
75
111
  :name => 'tags',
76
112
  :desc => "comma-separated list of key=value pairs to apply",
@@ -318,6 +354,7 @@ module Stemcell
318
354
 
319
355
  # convert security_groups from comma seperated string to ruby array
320
356
  options['security_groups'] &&= options['security_groups'].split(',')
357
+ options['security_group_ids'] &&= options['security_group_ids'].split(',')
321
358
  # convert ephemeral_devices from comma separated string to ruby array
322
359
  options['ephemeral_devices'] &&= options['ephemeral_devices'].split(',')
323
360
 
@@ -92,7 +92,7 @@ install_chef() {
92
92
  package_local="/tmp/chef_${chef_version}.deb"
93
93
  package_url="<%= opts['chef_package_source'] %>"
94
94
  echo "Downloading chef from $package_url"
95
- wget $package_url -O $package_local
95
+ wget $package_url -O $package_local --progress=dot:mega
96
96
  echo "Installing chef $chef_version"
97
97
  dpkg -i $package_local
98
98
  rm $package_local
@@ -101,6 +101,12 @@ install_chef() {
101
101
  fi
102
102
  }
103
103
 
104
+ create_ohai_hint() {
105
+ ohai_hints_dir="${chef_dir}/ohai/hints"
106
+ mkdir -p $ohai_hints_dir
107
+ touch "${ohai_hints_dir}/ec2.json"
108
+ }
109
+
104
110
  update_repo() {
105
111
  echo -e "$git_key" > $keyfile
106
112
  chmod 0400 $keyfile
@@ -230,6 +236,7 @@ install curl
230
236
  install git
231
237
  set_hostname
232
238
  install_chef
239
+ create_ohai_hint
233
240
  update_repo
234
241
  configure_chef
235
242
  configure_converger
@@ -1,3 +1,3 @@
1
1
  module Stemcell
2
- VERSION = "0.7.1"
2
+ VERSION = "0.8.0"
3
3
  end
data/stemcell.gemspec CHANGED
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.description = %q{A tool for launching and bootstrapping EC2 instances}
11
11
  s.summary = %q{no summary}
12
12
  s.homepage = "https://github.com/airbnb/stemcell"
13
+ s.license = 'MIT'
13
14
 
14
15
  s.files = `git ls-files`.split($/)
15
16
  s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stemcell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
5
- prerelease:
4
+ version: 0.8.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Martin Rhoads
@@ -12,12 +11,11 @@ authors:
12
11
  autorequire:
13
12
  bindir: bin
14
13
  cert_chain: []
15
- date: 2014-07-18 00:00:00.000000000 Z
14
+ date: 2014-08-21 00:00:00.000000000 Z
16
15
  dependencies:
17
16
  - !ruby/object:Gem::Dependency
18
17
  name: aws-sdk
19
18
  requirement: !ruby/object:Gem::Requirement
20
- none: false
21
19
  requirements:
22
20
  - - ~>
23
21
  - !ruby/object:Gem::Version
@@ -25,7 +23,6 @@ dependencies:
25
23
  type: :runtime
26
24
  prerelease: false
27
25
  version_requirements: !ruby/object:Gem::Requirement
28
- none: false
29
26
  requirements:
30
27
  - - ~>
31
28
  - !ruby/object:Gem::Version
@@ -33,7 +30,6 @@ dependencies:
33
30
  - !ruby/object:Gem::Dependency
34
31
  name: net-ssh
35
32
  requirement: !ruby/object:Gem::Requirement
36
- none: false
37
33
  requirements:
38
34
  - - ~>
39
35
  - !ruby/object:Gem::Version
@@ -41,7 +37,6 @@ dependencies:
41
37
  type: :runtime
42
38
  prerelease: false
43
39
  version_requirements: !ruby/object:Gem::Requirement
44
- none: false
45
40
  requirements:
46
41
  - - ~>
47
42
  - !ruby/object:Gem::Version
@@ -49,7 +44,6 @@ dependencies:
49
44
  - !ruby/object:Gem::Dependency
50
45
  name: chef
51
46
  requirement: !ruby/object:Gem::Requirement
52
- none: false
53
47
  requirements:
54
48
  - - ! '>='
55
49
  - !ruby/object:Gem::Version
@@ -57,7 +51,6 @@ dependencies:
57
51
  type: :runtime
58
52
  prerelease: false
59
53
  version_requirements: !ruby/object:Gem::Requirement
60
- none: false
61
54
  requirements:
62
55
  - - ! '>='
63
56
  - !ruby/object:Gem::Version
@@ -65,7 +58,6 @@ dependencies:
65
58
  - !ruby/object:Gem::Dependency
66
59
  name: trollop
67
60
  requirement: !ruby/object:Gem::Requirement
68
- none: false
69
61
  requirements:
70
62
  - - ~>
71
63
  - !ruby/object:Gem::Version
@@ -73,7 +65,6 @@ dependencies:
73
65
  type: :runtime
74
66
  prerelease: false
75
67
  version_requirements: !ruby/object:Gem::Requirement
76
- none: false
77
68
  requirements:
78
69
  - - ~>
79
70
  - !ruby/object:Gem::Version
@@ -81,7 +72,6 @@ dependencies:
81
72
  - !ruby/object:Gem::Dependency
82
73
  name: aws-creds
83
74
  requirement: !ruby/object:Gem::Requirement
84
- none: false
85
75
  requirements:
86
76
  - - ~>
87
77
  - !ruby/object:Gem::Version
@@ -89,7 +79,6 @@ dependencies:
89
79
  type: :runtime
90
80
  prerelease: false
91
81
  version_requirements: !ruby/object:Gem::Requirement
92
- none: false
93
82
  requirements:
94
83
  - - ~>
95
84
  - !ruby/object:Gem::Version
@@ -97,7 +86,6 @@ dependencies:
97
86
  - !ruby/object:Gem::Dependency
98
87
  name: colored
99
88
  requirement: !ruby/object:Gem::Requirement
100
- none: false
101
89
  requirements:
102
90
  - - ~>
103
91
  - !ruby/object:Gem::Version
@@ -105,7 +93,6 @@ dependencies:
105
93
  type: :runtime
106
94
  prerelease: false
107
95
  version_requirements: !ruby/object:Gem::Requirement
108
- none: false
109
96
  requirements:
110
97
  - - ~>
111
98
  - !ruby/object:Gem::Version
@@ -113,7 +100,6 @@ dependencies:
113
100
  - !ruby/object:Gem::Dependency
114
101
  name: json
115
102
  requirement: !ruby/object:Gem::Requirement
116
- none: false
117
103
  requirements:
118
104
  - - ~>
119
105
  - !ruby/object:Gem::Version
@@ -121,7 +107,6 @@ dependencies:
121
107
  type: :runtime
122
108
  prerelease: false
123
109
  version_requirements: !ruby/object:Gem::Requirement
124
- none: false
125
110
  requirements:
126
111
  - - ~>
127
112
  - !ruby/object:Gem::Version
@@ -138,6 +123,7 @@ extra_rdoc_files: []
138
123
  files:
139
124
  - .gitignore
140
125
  - .travis.yml
126
+ - CHANGELOG.md
141
127
  - Gemfile
142
128
  - Gemfile.lock
143
129
  - LICENSE.txt
@@ -187,28 +173,28 @@ files:
187
173
  - spec/support/fixture_helper.rb
188
174
  - stemcell.gemspec
189
175
  homepage: https://github.com/airbnb/stemcell
190
- licenses: []
176
+ licenses:
177
+ - MIT
178
+ metadata: {}
191
179
  post_install_message:
192
180
  rdoc_options: []
193
181
  require_paths:
194
182
  - lib
195
183
  required_ruby_version: !ruby/object:Gem::Requirement
196
- none: false
197
184
  requirements:
198
185
  - - ! '>='
199
186
  - !ruby/object:Gem::Version
200
187
  version: '0'
201
188
  required_rubygems_version: !ruby/object:Gem::Requirement
202
- none: false
203
189
  requirements:
204
190
  - - ! '>='
205
191
  - !ruby/object:Gem::Version
206
192
  version: '0'
207
193
  requirements: []
208
194
  rubyforge_project:
209
- rubygems_version: 1.8.23.2
195
+ rubygems_version: 2.4.1
210
196
  signing_key:
211
- specification_version: 3
197
+ specification_version: 4
212
198
  summary: no summary
213
199
  test_files:
214
200
  - spec/fixtures/chef_repo/roles-expected-metadata/unit-inherit-both.json