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

ARCHITECTURE

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.



12
13
14
15
# File 'lib/kitchen/driver/aws/standard_platform/rhel.rb', line 12

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

Class Method Details

.from_image(driver, image) ⇒ Object



30
31
32
33
34
35
# File 'lib/kitchen/driver/aws/standard_platform/rhel.rb', line 30

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



21
22
23
24
25
26
27
28
# File 'lib/kitchen/driver/aws/standard_platform/rhel.rb', line 21

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

#usernameObject



17
18
19
# File 'lib/kitchen/driver/aws/standard_platform/rhel.rb', line 17

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