Class: Kitchen::Driver::Aws::StandardPlatform::Rocky
- Inherits:
-
StandardPlatform
- Object
- StandardPlatform
- Kitchen::Driver::Aws::StandardPlatform::Rocky
- Defined in:
- lib/kitchen/driver/aws/standard_platform/rocky.rb
Overview
Rocky Linux images published by the Rocky Enterprise Software Foundation.
Class Method Summary collapse
-
.from_image(driver, image) ⇒ Rocky?
Detect this platform from an EC2 image.
Instance Method Summary collapse
-
#image_search ⇒ Hash{String => String, Array<String>}
EC2 image filters that select Rocky Linux images published by the Rocky project.
-
#username ⇒ String
The account EC2 creates on this platform's official AMIs.
Class Method Details
.from_image(driver, image) ⇒ Rocky?
Detect this platform from an EC2 image.
Matching is done on the image name, which is the only reliable signal EC2 exposes about what an AMI actually contains.
64 65 66 67 68 69 70 71 72 73 |
# File 'lib/kitchen/driver/aws/standard_platform/rocky.rb', line 64 def self.from_image(driver, image) return unless /Rocky-/i.match?(image.name) # `(\.\d+)?`, not `(\.\d+[\.\d])?`: the character class matched the # separator that follows the minor version, capturing it into the # version string ("2018.03.") and failing outright when the minor # version was followed by anything but a dot or digit. image.name =~ /\b(\d+(\.\d+)?)/i new(driver, "rocky", (Regexp.last_match || [])[1], image.architecture) end |
Instance Method Details
#image_search ⇒ Hash{String => String, Array<String>}
EC2 image filters that select Rocky Linux images published by the Rocky project.
A filter is added for Kitchen::Driver::Aws::StandardPlatform#architecture only when one was requested, so that an unspecified architecture matches any of them.
47 48 49 50 51 52 53 54 |
# File 'lib/kitchen/driver/aws/standard_platform/rocky.rb', line 47 def image_search search = { "owner-id" => "792107900819", "name" => version ? "Rocky-#{version}-*" : "Rocky-*", } search["architecture"] = architecture if architecture search end |
#username ⇒ String
The account EC2 creates on this platform's official AMIs.
Used as the SSH username when the transport does not specify one.
35 36 37 |
# File 'lib/kitchen/driver/aws/standard_platform/rocky.rb', line 35 def username "rocky" end |