poise-boiler 1.13.2 → 1.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f7b1b4134b3b7492607f45b1b07b8a81b6d95f2
4
- data.tar.gz: efbf4127eb413f709425a4b72dd6a1745a632872
3
+ metadata.gz: f57300a29b2e9a7c8bc9fcc44a4776f72de99830
4
+ data.tar.gz: 9247d44758c5307eb3371c9862f217219db3b680
5
5
  SHA512:
6
- metadata.gz: 31c3ca03fbeec4e6c24319fd6f4299d122c1f6982b75159717954adf84b3b2c1af0576e88393fe4f3edfdcbed4ad0ce6c253374099c5f9514452e0906f4f68e7
7
- data.tar.gz: 70cc8958b9d30c26ca599df855728cd7324bbbcab3f77fd5850ecfac29f0a749f7819776290644dd176579ef7d8c603ce196d76d7d9c32dcdf89e4ec0107f652
6
+ metadata.gz: 1c20b4be76e93d84bc27a9122920c9bc57302201d33dfcd6383b4bf0784c5ab2f9fbb41b96572272bf0acfde5f19eb2c0a6eef86d1e73e459c545016384197e0
7
+ data.tar.gz: 8737d162302255f2ac401d3360ee5dd7d7724752974a11fd2ab71a974958adb09c2cdb235b0e8f82e6ee57777606c6c9d1d7c1b4dc545775735565466a5c98ac
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Poise-Boiler Changelog
2
2
 
3
+ ## 1.14.0
4
+
5
+ * Improvements to EC2 and Windows testing with Kitchen. EC2 data handling is now
6
+ mostly standardized with some reasonable defaults.
7
+
3
8
  ## 1.13.2
4
9
 
5
10
  * Re-allow older WinRM gems for ChefDK testing.
@@ -18,3 +18,4 @@ eval_gemfile File.expand_path('../../Gemfile', __FILE__)
18
18
 
19
19
  gem 'chef', github: 'chef/chef'
20
20
  gem 'halite', github: 'poise/halite'
21
+ gem 'ohai', github: 'chef/ohai'
@@ -29,6 +29,7 @@ module PoiseBoiler
29
29
  # @see #expand_platforms
30
30
  PLATFORM_ALIASES = {
31
31
  'windows' => %w{windows-2012r2},
32
+ 'windows32' => %w{windows-2008sp2},
32
33
  'ubuntu' => %w{ubuntu-12.04 ubuntu-14.04},
33
34
  'rhel' => %w{centos},
34
35
  'centos' => %w{centos-6 centos-7},
@@ -37,6 +38,15 @@ module PoiseBoiler
37
38
  'all' => %w{unix windows},
38
39
  }
39
40
 
41
+ # Default EC2 subnet ID when not overridden in the environment or config.
42
+ DEFAULT_EC2_SUBNET_ID = 'subnet-ca674af7'
43
+
44
+ # Default EC2 subnet ID for previous-generation instance types.
45
+ DEFAULT_EC2_LEGACY_INSTANCES_SUBNET_ID = 'subnet-1ffec232'
46
+
47
+ # Default EC2 security group when not overridden in the environment or config.
48
+ DEFAULT_EC2_SECURITY_GROUP_ID = 'sg-ed1ad892'
49
+
40
50
  def initialize(**options)
41
51
  # Figure out the directory that contains the kitchen.yml by looking for
42
52
  # the first entry in the stack that isn't inside poise-boiler.
@@ -155,9 +165,7 @@ module PoiseBoiler
155
165
  # Set a default instance size.
156
166
  config['flavor_id'] = options[:rackspace_flavor] || 'general1-1'
157
167
  when 'ec2'
158
- # Allow passing some values as environment variables.
159
- config['security_group_ids'] = [ENV['AWS_SECURITY_GROUP_ID']]
160
- config['subnet_id'] = ENV['AWS_SUBNET_ID']
168
+ config.update(ec2_driver_config)
161
169
  end
162
170
  config
163
171
  end
@@ -169,8 +177,15 @@ module PoiseBoiler
169
177
  {
170
178
  # Use the sftp transport from kitchen-sync.
171
179
  'name' => 'sftp',
172
- # Use the generated SSH key from kitchen-docker if present.
173
- 'ssh_key' => kitchen_driver == 'docker' ? File.expand_path('.kitchen/docker_id_rsa', base) : nil,
180
+ # Use the SSH key for this driver.
181
+ 'ssh_key' => case kitchen_driver
182
+ when 'docker'
183
+ "#{base}/.kitchen/docker_id_rsa"
184
+ when 'ec2'
185
+ "#{base}/test/ec2/ssh.key"
186
+ else
187
+ nil
188
+ end,
174
189
  }
175
190
  end
176
191
 
@@ -209,16 +224,27 @@ module PoiseBoiler
209
224
  # Generate extra Test Kitchen platform configuration for Windows hosts.
210
225
  def windows_platform_config(name)
211
226
  {
212
- 'driver' => {
213
- 'name' => 'ec2',
227
+ 'driver' => ec2_driver_config.merge({
214
228
  'instance_type' => 'm3.medium',
215
- 'aws_ssh_key_id' => 'ec2',
229
+ 'retryable_tries' => 120,
230
+ }),
231
+ 'provisioner' => {
232
+ 'product_name' => 'chef',
233
+ 'channel' => chef_version ? 'stable' : 'current',
234
+ 'product_version' => chef_version,
216
235
  },
217
236
  'transport' => {
218
237
  'name' => 'winrm',
219
- 'ssh_key' => File.expand_path('~/.ssh/ec2.pem'),
238
+ 'ssh_key' => "#{base}/test/ec2/ssh.key",
220
239
  },
221
- }
240
+ }.tap do |cfg|
241
+ if name == 'windows-2008sp2'
242
+ cfg['driver']['image_id'] = 'ami-f6a043e0'
243
+ cfg['driver']['instance_type'] = 'm1.medium'
244
+ cfg['driver']['subnet_id'] = ENV['AWS_SUBNET_ID'] || DEFAULT_EC2_LEGACY_INSTANCES_SUBNET_ID
245
+ cfg['provisioner']['architecture'] = 'i386'
246
+ end
247
+ end
222
248
  end
223
249
 
224
250
  # Generate a Test Kitchen suite configuration hash. This is a single suite
@@ -232,6 +258,19 @@ module PoiseBoiler
232
258
  }
233
259
  end
234
260
 
261
+ # Generate a Test Kitchen driver configuration hash with basic settings
262
+ # for kitchen-ec2.
263
+ #
264
+ # @return [Hash]
265
+ def ec2_driver_config
266
+ {
267
+ 'name' => 'ec2',
268
+ 'aws_ssh_key_id' => "#{cookbook_name}-kitchen",
269
+ 'security_group_ids' => ENV['AWS_SECURITY_GROUP_ID'] ? [ENV['AWS_SECURITY_GROUP_ID']] : [DEFAULT_EC2_SECURITY_GROUP_ID],
270
+ 'subnet_id' => ENV['AWS_SUBNET_ID'] || DEFAULT_EC2_SUBNET_ID,
271
+ }
272
+ end
273
+
235
274
  end
236
275
  end
237
276
  end
@@ -56,8 +56,30 @@ module PoiseBoiler
56
56
  sh(*cmd)
57
57
  end
58
58
 
59
+ task 'travis:integration:rackspace' do
60
+ if integration_rackspace?
61
+ shell.say('Configuring Rackspace test dependencies')
62
+ task('.ssh/id_rsa').invoke
63
+ end
64
+ end
65
+
66
+ task 'travis:integration:docker' do
67
+ if integration_docker?
68
+ shell.say('Configuring Docker test dependencies')
69
+ task('test/docker/docker.key').invoke
70
+ task('./docker').invoke
71
+ end
72
+ end
73
+
74
+ task 'travis:integration:ec2' do
75
+ if ENV['KITCHEN_EC2_PASS']
76
+ shell.say('Configuring EC2 test dependencies')
77
+ sh(*%w{openssl rsa -in test/ec2/ssh.pem -passin env:KITCHEN_EC2_PASS -out test/ec2/ssh.key})
78
+ end
79
+ end
80
+
59
81
  desc 'Run Test-Kitchen integration tests.'
60
- task 'travis:integration' => ( ( integration_rackspace? ? %w{.ssh/id_rsa} : integration_docker? ? %w{test/docker/docker.key ./docker} : [] ) + %w{chef:kitchen} )
82
+ task 'travis:integration' => %w{travis:integration:rackspace travis:integration:docker travis:integration:ec2 chef:kitchen}
61
83
 
62
84
  desc 'Run CI tests'
63
85
  task 'travis' do
@@ -16,5 +16,5 @@
16
16
 
17
17
 
18
18
  module PoiseBoiler
19
- VERSION = '1.13.2'
19
+ VERSION = '1.14.0'
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poise-boiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.2
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Kantrowitz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-25 00:00:00.000000000 Z
11
+ date: 2017-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler