Sha256: 284aaf753b54d4e64192d13b3b02c624400389008304dcaa4db4a2048881f164

Contents?: true

Size: 949 Bytes

Versions: 2

Compression:

Stored size: 949 Bytes

Contents

module Beaker
  module Utils
    module Validator
      PACKAGES = ['curl']
      UNIX_PACKAGES = ['ntpdate']
      SLES_PACKAGES = ['ntp']

      def self.validate(hosts, logger)
        hosts.each do |host|
          PACKAGES.each do |pkg|
            if not host.check_for_package pkg
              host.install_package pkg
            end
          end
          case
            when host['platform'] =~ /sles-/
              SLES_PACKAGES.each do |pkg|
                if not host.check_for_package pkg
                  host.install_package pkg
                end
              end

            when host['platform'] !~ /(windows)|(aix)|(solaris)/
              UNIX_PACKAGES.each do |pkg|
                if not host.check_for_package pkg
                  host.install_package pkg
                end
              end
          end
        end
      rescue => e
        report_and_raise(logger, e, "validate")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
beaker-1.8.1 lib/beaker/utils/validator.rb
beaker-1.8.0 lib/beaker/utils/validator.rb