Class: Kitchen::Driver::Aws::StandardPlatform::Fedora

Inherits:
StandardPlatform
  • Object
show all
Defined in:
lib/kitchen/driver/aws/standard_platform/fedora.rb

Overview

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_image(driver, image) ⇒ Fedora?

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.

Parameters:

  • driver (Kitchen::Driver::Ec2) —

    the driver requesting detection

  • image (Aws::EC2::Image) —

    the image to inspect

Returns:

  • (Fedora, nil) —

    a platform when the image is Fedora, otherwise nil



60
61
62
63
64
65
# File 'lib/kitchen/driver/aws/standard_platform/fedora.rb', line 60

def self.from_image(driver, image)
  return unless /fedora/i.match?(image.name)

  image.name =~ /\b(\d+(\.\d+)?)\b/i
  new(driver, "fedora", (Regexp.last_match || [])[1], image.architecture)
end

Instance Method Details

#image_search ⇒ Hash{String => String, Array<String>}

EC2 image filters that select Fedora Cloud Base images.

A filter is added for Kitchen::Driver::Aws::StandardPlatform#architecture only when one was requested, so that an unspecified architecture matches any of them.

Returns:

  • (Hash{String => String, Array<String>}) —

    filter name to the value or values it must match

See Also:



43
44
45
46
47
48
49
50
# File 'lib/kitchen/driver/aws/standard_platform/fedora.rb', line 43

def image_search
  search = {
    "owner-id" => "125523088429",
    "name" => version ? "Fedora-Cloud-Base-#{version}-*" : "Fedora-Cloud-Base-*",
  }
  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.

Returns:

  • (String) —

    the default SSH username



31
32
33
# File 'lib/kitchen/driver/aws/standard_platform/fedora.rb', line 31

def username
  "fedora"
end