kitchen-ec2 2.3.4 → 2.4.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 714d5ed1bda973c33eedf4647ef020a93fc675c6c02c09bcf937a4c0ec301b28
4
- data.tar.gz: d85332b3502961f84742295f6b026dca2f0007acec694c1d407094864728cd2d
3
+ metadata.gz: 817c9661208d141986f8c3472fd9a4b5bc4bcb6c7a290d7c400b99336c0b32a8
4
+ data.tar.gz: a375e11a4dae0946170a813988df073550374d5b682de5f0d1fcc6e6356f4bb5
5
5
  SHA512:
6
- metadata.gz: 4c68dc46ff65c7a55281554601e1f5fd7245b110678e022588884a4836d9ab2162ec483b077daae260de53bba1719e21b302ec6740ec24026837190102718914
7
- data.tar.gz: df920b4f903ba95d3ba2b885149d0bef4f678db5919a257e3eb72684f9ba8487c9c8611f0bb35d27c5115b0f8ecbedad17bec2897e54f0a75ae8c3a4fe87ac4c
6
+ metadata.gz: 0b67befd11e0dfacf356ca1fe0bcb36a9d2cf26fa553312203771a77d4123ef7fa4718ef76ad152d0625b744edaa4c14f086303eef3bf59d7228df7187cac0df
7
+ data.tar.gz: 7ee59275ba3647c4c1d7771e22da109a81258f813c3c45142aacf6e7a08ea2846b5cf67e26f2abb2e7c97960f2daa133858df839ae594685d6b5bc154676f131
@@ -0,0 +1,49 @@
1
+ #
2
+ # Copyright:: 2016-2018, Chef Software, Inc.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ require "kitchen/driver/aws/standard_platform"
17
+
18
+ module Kitchen
19
+ module Driver
20
+ class Aws
21
+ class StandardPlatform
22
+ # https://aws.amazon.com/de/amazon-linux-2/release-notes/
23
+ class Amazon2 < StandardPlatform
24
+ StandardPlatform.platforms["amazon2"] = self
25
+
26
+ def username
27
+ "ec2-user"
28
+ end
29
+
30
+ def image_search
31
+ search = {
32
+ "owner-id" => "137112412989",
33
+ "name" => version ? "amzn2-ami-hvm-2.0.#{version}*" : "amzn2-ami-hvm-2.0.*",
34
+ }
35
+ search["architecture"] = architecture if architecture
36
+ search
37
+ end
38
+
39
+ def self.from_image(driver, image)
40
+ if image.name =~ /amzn2-ami/i
41
+ image.name =~ /\b(\d+(\.\d+[\.\d])?)/i
42
+ new(driver, "amazon2", (Regexp.last_match || [])[1], image.architecture)
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -94,6 +94,8 @@ module Kitchen
94
94
  # 2012sp4 -> [ 2012, 0, 4 ]
95
95
  # 2012rtm -> [ 2012, 0, 0 ]
96
96
  # 2016 -> [ 2016, 0, nil ]
97
+ # 1709 -> [ 1709, 0, nil ]
98
+ # 1803 -> [ 1803, 0, nil ]
97
99
  def windows_version_parts
98
100
  version = self.version
99
101
  if version
@@ -130,6 +132,8 @@ module Kitchen
130
132
 
131
133
  if major == 2016
132
134
  "Windows_Server-2016-English-Full-Base-*"
135
+ elsif major == 1709 || major == 1803
136
+ "Windows_Server-#{major}-English-Core-ContainersLatest-*"
133
137
  else
134
138
  case revision
135
139
  when nil
@@ -25,6 +25,7 @@ require_relative "aws/client"
25
25
  require_relative "aws/instance_generator"
26
26
  require_relative "aws/standard_platform"
27
27
  require_relative "aws/standard_platform/amazon"
28
+ require_relative "aws/standard_platform/amazon2"
28
29
  require_relative "aws/standard_platform/centos"
29
30
  require_relative "aws/standard_platform/debian"
30
31
  require_relative "aws/standard_platform/rhel"
@@ -632,15 +633,14 @@ module Kitchen
632
633
  def default_windows_user_data
633
634
  base_script = Kitchen::Util.outdent!(<<-EOH)
634
635
  $OSVersion = (get-itemproperty -Path "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" -Name ProductName).ProductName
635
- If($OSVersion.contains('2016'))
636
- {
637
- $logfile='C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Log\\kitchen-ec2.log'
638
- # EC2Launch doesn't init extra disks by default
639
- C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\InitializeDisks.ps1
640
- }
641
- Else
642
- {
643
- $logfile='C:\\Program Files\\Amazon\\Ec2ConfigService\\Logs\\kitchen-ec2.log'
636
+ If($OSVersion.contains('2016') -Or $OSVersion -eq 'Windows Server Datacenter') {
637
+ New-Item -ItemType Directory -Force -Path 'C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Log'
638
+ $logfile='C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Log\\kitchen-ec2.log'
639
+ # EC2Launch doesn't init extra disks by default
640
+ C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\InitializeDisks.ps1
641
+ } Else {
642
+ New-Item -ItemType Directory -Force -Path 'C:\\Program Files\\Amazon\\Ec2ConfigService\\Logs'
643
+ $logfile='C:\\Program Files\\Amazon\\Ec2ConfigService\\Logs\\kitchen-ec2.log'
644
644
  }
645
645
 
646
646
  # Logfile fail-safe in case the directory does not exist
@@ -22,6 +22,6 @@ module Kitchen
22
22
  module Driver
23
23
 
24
24
  # Version string for EC2 Test Kitchen driver
25
- EC2_VERSION = "2.3.4"
25
+ EC2_VERSION = "2.4.0"
26
26
  end
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-ec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.4
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-04 00:00:00.000000000 Z
11
+ date: 2018-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -202,6 +202,7 @@ files:
202
202
  - lib/kitchen/driver/aws/instance_generator.rb
203
203
  - lib/kitchen/driver/aws/standard_platform.rb
204
204
  - lib/kitchen/driver/aws/standard_platform/amazon.rb
205
+ - lib/kitchen/driver/aws/standard_platform/amazon2.rb
205
206
  - lib/kitchen/driver/aws/standard_platform/centos.rb
206
207
  - lib/kitchen/driver/aws/standard_platform/debian.rb
207
208
  - lib/kitchen/driver/aws/standard_platform/fedora.rb