Class: Kitchen::Driver::Aws::StandardPlatform::Freebsd
- Inherits:
-
StandardPlatform
- Object
- StandardPlatform
- Kitchen::Driver::Aws::StandardPlatform::Freebsd
- Defined in:
- lib/kitchen/driver/aws/standard_platform/freebsd.rb
Overview
Class Method Summary collapse
-
.from_image(driver, image) ⇒ Freebsd?
Detect this platform from an EC2 image.
Instance Method Summary collapse
-
#image_search ⇒ Hash{String => String, Array<String>}
EC2 image filters that select FreeBSD RELEASE images.
-
#sudo_command ⇒ nil
The command used to elevate privileges on this platform.
-
#username ⇒ String
The account EC2 creates on this platform's official AMIs.
Class Method Details
.from_image(driver, image) ⇒ Freebsd?
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.
68 69 70 71 72 73 |
# File 'lib/kitchen/driver/aws/standard_platform/freebsd.rb', line 68 def self.from_image(driver, image) return unless /freebsd/i.match?(image.name) image.name =~ /\b(\d+(\.\d+)?)\b/i new(driver, "freebsd", (Regexp.last_match || [])[1], image.architecture) end |
Instance Method Details
#image_search ⇒ Hash{String => String, Array<String>}
EC2 image filters that select FreeBSD RELEASE 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.
51 52 53 54 55 56 57 58 |
# File 'lib/kitchen/driver/aws/standard_platform/freebsd.rb', line 51 def image_search search = { "owner-id" => "118940168514", "name" => ["FreeBSD #{version}*-RELEASE*", "FreeBSD/EC2 #{version}*-RELEASE*"], } search["architecture"] = architecture if architecture search end |
#sudo_command ⇒ nil
The command used to elevate privileges on this platform.
FreeBSD AMIs do not configure sudo for the default account, so this is deliberately nil rather than the usual "sudo".
41 |
# File 'lib/kitchen/driver/aws/standard_platform/freebsd.rb', line 41 def sudo_command; 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.
31 32 33 |
# File 'lib/kitchen/driver/aws/standard_platform/freebsd.rb', line 31 def username "ec2-user" end |