kitchen-ec2 3.14.0 → 3.15.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
  SHA256:
3
- metadata.gz: 0ab954ba95ae18b5a8af7013f2c2a62ac9437375ea4c4d9fa82c09448335b6ee
4
- data.tar.gz: d721117b22321834df518eb5c0a8c14495141148546b48717a337f8953457c20
3
+ metadata.gz: f3b81a785bd64e6ae13091e71fe8faf3b295755fc9b30d4cee0c84246a107ea1
4
+ data.tar.gz: c0bfc45018438894ebb3775204d3e712ed5aef754a81b7588cb0cca79369e2ab
5
5
  SHA512:
6
- metadata.gz: 19cff1d09410833ec15c2407d0e14a454c681f5d3044f50e6bb8713050e3ec7524c56b94d9232b8c09f7e25fe9f05fd7b28bff00bda60ba13de9ac1723520da2
7
- data.tar.gz: ece685664f0dfb5e7aacb7af3e97d565f005f653a9be2f9ee7c6fbd7566f57a831aba2e3fc3c38a3b098159f3130a95f821c9021400d14f1d471b16fac7113d4
6
+ metadata.gz: 0d13f84f11907b1fb657dca1a400173be055420c30a7a5282af7273c7f1ecfd48485abdf24dc1d1fbe1fa67f4642564b080243f1fdae9d1e400052e3119e7f68
7
+ data.tar.gz: bb606e4db8b58e7ed57951cca247e4c8271fdbe5430ba59102f2524c0de9201ab46ea38fb431101f92ea02ac720ea508f5b59abb383ed4ffab5821f251366a71
@@ -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
+ class MacOS < StandardPlatform
23
+ StandardPlatform.platforms["macos"] = self
24
+
25
+ # default username for this platform's ami
26
+ # @return [String]
27
+ def username
28
+ "ec2-user"
29
+ end
30
+
31
+ def image_search
32
+ search = {
33
+ "owner-id" => "100343932686",
34
+ "name" => version ? "amzn-ec2-macos-#{version}*" : "amzn2-ec2-macos-*",
35
+ }
36
+ search["architecture"] = architecture if architecture
37
+ search["architecture"] = "arm64_mac" if architecture == "arm64"
38
+ search
39
+ end
40
+
41
+ def self.from_image(driver, image)
42
+ if /amzn-ec2-macos/i.match?(image.name)
43
+ image.name =~ /\b(\d+(\.\d+[\.\d])?)/i
44
+ new(driver, "macos", (Regexp.last_match || [])[1], image.architecture)
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -27,6 +27,7 @@ module Kitchen
27
27
  # rhel
28
28
  # fedora
29
29
  # freebsd
30
+ # macos
30
31
  # ubuntu
31
32
  # windows
32
33
  #
@@ -31,6 +31,7 @@ require_relative "aws/standard_platform/debian"
31
31
  require_relative "aws/standard_platform/rhel"
32
32
  require_relative "aws/standard_platform/fedora"
33
33
  require_relative "aws/standard_platform/freebsd"
34
+ require_relative "aws/standard_platform/macos"
34
35
  require_relative "aws/standard_platform/ubuntu"
35
36
  require_relative "aws/standard_platform/windows"
36
37
  require "aws-sdk-ec2"
@@ -79,6 +80,7 @@ module Kitchen
79
80
  default_config :aws_secret_access_key, nil
80
81
  default_config :aws_session_token, nil
81
82
  default_config :aws_ssh_key_id, ENV["AWS_SSH_KEY_ID"]
83
+ default_config :aws_ssh_key_type, "rsa"
82
84
  default_config :image_id, &:default_ami
83
85
  default_config :image_search, nil
84
86
  default_config :username, nil
@@ -853,7 +855,7 @@ module Kitchen
853
855
  # to rapidly exhaust local entropy by creating a lot of keys. So this is
854
856
  # probably fine. If you want very high security, probably don't use this
855
857
  # feature anyway.
856
- resp = ec2.client.create_key_pair(key_name: "kitchen-#{name_parts.join("-")}")
858
+ resp = ec2.client.create_key_pair(key_name: "kitchen-#{name_parts.join("-")}", key_type: config[:aws_ssh_key_type])
857
859
  state[:auto_key_id] = resp.key_name
858
860
  info("Created automatic key pair #{state[:auto_key_id]}")
859
861
  # Write the key out with safe permissions
@@ -21,6 +21,6 @@ module Kitchen
21
21
  module Driver
22
22
 
23
23
  # Version string for EC2 Test Kitchen driver
24
- EC2_VERSION = "3.14.0".freeze
24
+ EC2_VERSION = "3.15.0".freeze
25
25
  end
26
26
  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: 3.14.0
4
+ version: 3.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-02 00:00:00.000000000 Z
11
+ date: 2022-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -82,6 +82,7 @@ files:
82
82
  - lib/kitchen/driver/aws/standard_platform/debian.rb
83
83
  - lib/kitchen/driver/aws/standard_platform/fedora.rb
84
84
  - lib/kitchen/driver/aws/standard_platform/freebsd.rb
85
+ - lib/kitchen/driver/aws/standard_platform/macos.rb
85
86
  - lib/kitchen/driver/aws/standard_platform/rhel.rb
86
87
  - lib/kitchen/driver/aws/standard_platform/ubuntu.rb
87
88
  - lib/kitchen/driver/aws/standard_platform/windows.rb
@@ -91,7 +92,7 @@ homepage: https://github.com/test-kitchen/kitchen-ec2
91
92
  licenses:
92
93
  - Apache-2.0
93
94
  metadata: {}
94
- post_install_message:
95
+ post_install_message:
95
96
  rdoc_options: []
96
97
  require_paths:
97
98
  - lib
@@ -106,8 +107,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
107
  - !ruby/object:Gem::Version
107
108
  version: '0'
108
109
  requirements: []
109
- rubygems_version: 3.2.32
110
- signing_key:
110
+ rubygems_version: 3.3.16
111
+ signing_key:
111
112
  specification_version: 4
112
113
  summary: A Test Kitchen Driver for Amazon EC2
113
114
  test_files: []