Sha256: a15b9137eee6271020396f2f72b3b070122d817e895b889b2a66bb3f72be3a3b

Contents?: true

Size: 1010 Bytes

Versions: 8

Compression:

Stored size: 1010 Bytes

Contents

require "kitchen/driver/aws/standard_platform"

module Kitchen
  module Driver
    class Aws
      class StandardPlatform
        # http://www.daemonology.net/freebsd-on-ec2/
        class Freebsd < StandardPlatform
          StandardPlatform.platforms["freebsd"] = self

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

          def sudo_command
          end

          def image_search
            search = {
              "owner-id" => "118940168514",
              "name" => ["FreeBSD #{version}*-RELEASE*", "FreeBSD/EC2 #{version}*-RELEASE*"]
            }
            search["architecture"] = architecture if architecture
            search
          end

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
kitchen-ec2-1.3.2 lib/kitchen/driver/aws/standard_platform/freebsd.rb
kitchen-ec2-1.3.1 lib/kitchen/driver/aws/standard_platform/freebsd.rb
kitchen-ec2-1.3.0 lib/kitchen/driver/aws/standard_platform/freebsd.rb
kitchen-ec2-1.2.0 lib/kitchen/driver/aws/standard_platform/freebsd.rb
kitchen-ec2-1.1.0 lib/kitchen/driver/aws/standard_platform/freebsd.rb
kitchen-ec2-1.0.1 lib/kitchen/driver/aws/standard_platform/freebsd.rb
kitchen-ec2-1.0.0 lib/kitchen/driver/aws/standard_platform/freebsd.rb
kitchen-ec2-1.0.0.beta.1 lib/kitchen/driver/aws/standard_platform/freebsd.rb