kitchen-ec2 3.15.0 → 3.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen/driver/aws/standard_platform/alma.rb +52 -0
- data/lib/kitchen/driver/aws/standard_platform/amazon2023.rb +51 -0
- data/lib/kitchen/driver/aws/standard_platform/centos.rb +1 -24
- data/lib/kitchen/driver/aws/standard_platform/rocky.rb +51 -0
- data/lib/kitchen/driver/ec2.rb +3 -0
- data/lib/kitchen/driver/ec2_version.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4993e5b97ddbe3fb98f8e58b9877bf90b3e0a165b521dc295d53dc9bcbbe192
|
4
|
+
data.tar.gz: 621bf0ddd53d9f8488ca6b7c351cf12c733cbcc534f23c30a3390b932fdc2e4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f62f3a41a041935cd4371e0cef514ec1a919f40ea8e21dc25bb84cec67dce7d97810469a3e220cc567daff040ba37da5cb026ddcb94aba0bdf86eec5adcffe6c
|
7
|
+
data.tar.gz: 7011bf26dc6e011af1af506b7ce9c42d5c26e1a19ff610896ed407200490d473b467dbf80a1260868e160e8d48da6792a1e0343dc5792eff2dbc09c7cee663fc
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: 2023, Jared Kauppila
|
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_relative "../standard_platform"
|
17
|
+
|
18
|
+
module Kitchen
|
19
|
+
module Driver
|
20
|
+
class Aws
|
21
|
+
class StandardPlatform
|
22
|
+
# https://wiki.almalinux.org/cloud/AWS.html
|
23
|
+
class Alma < StandardPlatform
|
24
|
+
StandardPlatform.platforms["alma"] = self
|
25
|
+
StandardPlatform.platforms["almalinux"] = self
|
26
|
+
|
27
|
+
# default username for this platform's ami
|
28
|
+
# @return [String]
|
29
|
+
def username
|
30
|
+
"ec2-user"
|
31
|
+
end
|
32
|
+
|
33
|
+
def image_search
|
34
|
+
search = {
|
35
|
+
"owner-id" => "764336703387",
|
36
|
+
"name" => version ? "AlmaLinux OS #{version}*" : "AlmaLinux OS *",
|
37
|
+
}
|
38
|
+
search["architecture"] = architecture if architecture
|
39
|
+
search
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.from_image(driver, image)
|
43
|
+
if /AlmaLinux OS/i.match?(image.name)
|
44
|
+
image.name =~ /\b(\d+(\.\d+)?)\b/i
|
45
|
+
new(driver, "alma", (Regexp.last_match || [])[1], image.architecture)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,51 @@
|
|
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_relative "../standard_platform"
|
17
|
+
|
18
|
+
module Kitchen
|
19
|
+
module Driver
|
20
|
+
class Aws
|
21
|
+
class StandardPlatform
|
22
|
+
# https://docs.aws.amazon.com/linux/al2023/release-notes/relnotes.html
|
23
|
+
class Amazon2023 < StandardPlatform
|
24
|
+
StandardPlatform.platforms["amazon2023"] = self
|
25
|
+
|
26
|
+
# default username for this platform's ami
|
27
|
+
# @return [String]
|
28
|
+
def username
|
29
|
+
"ec2-user"
|
30
|
+
end
|
31
|
+
|
32
|
+
def image_search
|
33
|
+
search = {
|
34
|
+
"owner-id" => "137112412989",
|
35
|
+
"name" => version ? "al2023-ami-2023.0.#{version}*" : "al2023-ami-2023.0.*",
|
36
|
+
}
|
37
|
+
search["architecture"] = architecture if architecture
|
38
|
+
search
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.from_image(driver, image)
|
42
|
+
if /al2023-ami/i.match?(image.name)
|
43
|
+
image.name =~ /\b(\d+(\.\d+[\.\d])?)/i
|
44
|
+
new(driver, "amazon2023", (Regexp.last_match || [])[1], image.architecture)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -24,20 +24,10 @@ module Kitchen
|
|
24
24
|
StandardPlatform.platforms["centos"] = self
|
25
25
|
|
26
26
|
CENTOS_OWNER_ID = "125523088429".freeze
|
27
|
-
PRODUCT_CODES = {
|
28
|
-
"6" => "6x5jmcajty9edm3f211pqjfn2",
|
29
|
-
"7" => "aw0evgkw8e5c1q413zgy5pjce",
|
30
|
-
# It appears that v8 is not published to the
|
31
|
-
# AWS marketplace and hence does not have a product code
|
32
|
-
}.freeze
|
33
27
|
|
34
28
|
# default username for this platform's ami
|
35
29
|
# @return [String]
|
36
30
|
def username
|
37
|
-
# Centos 6.x images use root as the username (but the "centos 6"
|
38
|
-
# updateable image uses "centos")
|
39
|
-
return "root" if version && version.start_with?("6.")
|
40
|
-
|
41
31
|
"centos"
|
42
32
|
end
|
43
33
|
|
@@ -45,22 +35,9 @@ module Kitchen
|
|
45
35
|
# Version 8+ are published directly, not to the AWS marketplace. Use OWNER ID.
|
46
36
|
search = {
|
47
37
|
"owner-id" => CENTOS_OWNER_ID,
|
48
|
-
"name" => ["CentOS #{version}*", "CentOS-#{version}*-GA-*"],
|
38
|
+
"name" => ["CentOS #{version}*", "CentOS-#{version}*-GA-*", "CentOS Linux #{version}*", "CentOS Stream #{version}*"],
|
49
39
|
}
|
50
40
|
|
51
|
-
if version && version.split(".").first.to_i < 8
|
52
|
-
# Versions <8 are published to the AWS marketplace and use a different naming convention
|
53
|
-
search = {
|
54
|
-
"owner-alias" => "aws-marketplace",
|
55
|
-
"name" => ["CentOS Linux #{version}*", "CentOS-#{version}*-GA-*"],
|
56
|
-
}
|
57
|
-
# For versions published to aws-marketplace, additionally filter on product code to
|
58
|
-
# avoid non-official AMIs. Can't use CentOS owner ID here, as the owner ID is that of aws marketplace.
|
59
|
-
# https://github.com/test-kitchen/kitchen-ec2/issues/456
|
60
|
-
PRODUCT_CODES.keys.each do |major_version|
|
61
|
-
search["product-code"] = PRODUCT_CODES[major_version] if version.start_with?(major_version)
|
62
|
-
end
|
63
|
-
end
|
64
41
|
search["architecture"] = architecture if architecture
|
65
42
|
search
|
66
43
|
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: 2023, Jared Kauppila
|
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_relative "../standard_platform"
|
17
|
+
|
18
|
+
module Kitchen
|
19
|
+
module Driver
|
20
|
+
class Aws
|
21
|
+
class StandardPlatform
|
22
|
+
class Rocky < StandardPlatform
|
23
|
+
StandardPlatform.platforms["rocky"] = self
|
24
|
+
StandardPlatform.platforms["rockylinux"] = self
|
25
|
+
|
26
|
+
# default username for this platform's ami
|
27
|
+
# @return [String]
|
28
|
+
def username
|
29
|
+
"rocky"
|
30
|
+
end
|
31
|
+
|
32
|
+
def image_search
|
33
|
+
search = {
|
34
|
+
"owner-id" => "792107900819",
|
35
|
+
"name" => version ? "Rocky-#{version}-*" : "Rocky-*",
|
36
|
+
}
|
37
|
+
search["architecture"] = architecture if architecture
|
38
|
+
search
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.from_image(driver, image)
|
42
|
+
if /Rocky-/i.match?(image.name)
|
43
|
+
image.name =~ /\b(\d+(\.\d+[\.\d])?)/i
|
44
|
+
new(driver, "rocky", (Regexp.last_match || [])[1], image.architecture)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/lib/kitchen/driver/ec2.rb
CHANGED
@@ -24,11 +24,14 @@ require_relative "aws/client"
|
|
24
24
|
require_relative "aws/dedicated_hosts"
|
25
25
|
require_relative "aws/instance_generator"
|
26
26
|
require_relative "aws/standard_platform"
|
27
|
+
require_relative "aws/standard_platform/alma"
|
27
28
|
require_relative "aws/standard_platform/amazon"
|
28
29
|
require_relative "aws/standard_platform/amazon2"
|
30
|
+
require_relative "aws/standard_platform/amazon2023"
|
29
31
|
require_relative "aws/standard_platform/centos"
|
30
32
|
require_relative "aws/standard_platform/debian"
|
31
33
|
require_relative "aws/standard_platform/rhel"
|
34
|
+
require_relative "aws/standard_platform/rocky"
|
32
35
|
require_relative "aws/standard_platform/fedora"
|
33
36
|
require_relative "aws/standard_platform/freebsd"
|
34
37
|
require_relative "aws/standard_platform/macos"
|
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: 3.
|
4
|
+
version: 3.17.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:
|
11
|
+
date: 2023-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|
@@ -76,14 +76,17 @@ files:
|
|
76
76
|
- lib/kitchen/driver/aws/dedicated_hosts.rb
|
77
77
|
- lib/kitchen/driver/aws/instance_generator.rb
|
78
78
|
- lib/kitchen/driver/aws/standard_platform.rb
|
79
|
+
- lib/kitchen/driver/aws/standard_platform/alma.rb
|
79
80
|
- lib/kitchen/driver/aws/standard_platform/amazon.rb
|
80
81
|
- lib/kitchen/driver/aws/standard_platform/amazon2.rb
|
82
|
+
- lib/kitchen/driver/aws/standard_platform/amazon2023.rb
|
81
83
|
- lib/kitchen/driver/aws/standard_platform/centos.rb
|
82
84
|
- lib/kitchen/driver/aws/standard_platform/debian.rb
|
83
85
|
- lib/kitchen/driver/aws/standard_platform/fedora.rb
|
84
86
|
- lib/kitchen/driver/aws/standard_platform/freebsd.rb
|
85
87
|
- lib/kitchen/driver/aws/standard_platform/macos.rb
|
86
88
|
- lib/kitchen/driver/aws/standard_platform/rhel.rb
|
89
|
+
- lib/kitchen/driver/aws/standard_platform/rocky.rb
|
87
90
|
- lib/kitchen/driver/aws/standard_platform/ubuntu.rb
|
88
91
|
- lib/kitchen/driver/aws/standard_platform/windows.rb
|
89
92
|
- lib/kitchen/driver/ec2.rb
|
@@ -100,14 +103,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
100
103
|
requirements:
|
101
104
|
- - ">="
|
102
105
|
- !ruby/object:Gem::Version
|
103
|
-
version: '2.
|
106
|
+
version: '2.7'
|
104
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
108
|
requirements:
|
106
109
|
- - ">="
|
107
110
|
- !ruby/object:Gem::Version
|
108
111
|
version: '0'
|
109
112
|
requirements: []
|
110
|
-
rubygems_version: 3.
|
113
|
+
rubygems_version: 3.4.12
|
111
114
|
signing_key:
|
112
115
|
specification_version: 4
|
113
116
|
summary: A Test Kitchen Driver for Amazon EC2
|