Class: Kitchen::Driver::Aws::StandardPlatform::El

Inherits:
Kitchen::Driver::Aws::StandardPlatform show all
Defined in:
lib/kitchen/driver/aws/standard_platform/rhel.rb

Overview

Constant Summary

Constants inherited from Kitchen::Driver::Aws::StandardPlatform

SUPPORTED_ARCHITECTURES

Instance Attribute Summary

Attributes inherited from Kitchen::Driver::Aws::StandardPlatform

#architecture, #driver, #name, #version

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Kitchen::Driver::Aws::StandardPlatform

#find_image, from_platform_string, platforms, #to_s

Constructor Details

#initialize(driver, _name, version, architecture) ⇒ El

Returns a new instance of El.


27
28
29
30
# File 'lib/kitchen/driver/aws/standard_platform/rhel.rb', line 27

def initialize(driver, _name, version, architecture)
  # rhel = el
  super(driver, "rhel", version, architecture)
end

Class Method Details

.from_image(driver, image) ⇒ Object


47
48
49
50
51
52
# File 'lib/kitchen/driver/aws/standard_platform/rhel.rb', line 47

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

Instance Method Details

#image_searchObject


38
39
40
41
42
43
44
45
# File 'lib/kitchen/driver/aws/standard_platform/rhel.rb', line 38

def image_search
  search = {
    "owner-id" => "309956199498",
    "name" => "RHEL-#{version}*",
  }
  search["architecture"] = architecture if architecture
  search
end

#usernameString

default username for this platform's ami

Returns:

  • (String)

34
35
36
# File 'lib/kitchen/driver/aws/standard_platform/rhel.rb', line 34

def username
  (version && version.to_f < 6.4) ? "root" : "ec2-user"
end