Sha256: 2edd00ff9299abe5da0a89fe2c9f9ebb4f5b237b555e9b4c1156ad745f34c370

Contents?: true

Size: 785 Bytes

Versions: 9

Compression:

Stored size: 785 Bytes

Contents

module Serverspec
  module Commands
    class RedHat < Linux
      def check_access_by_user(file, user, access)
        # Redhat-specific
        "runuser -c \"test -#{access} #{file}\" #{user}"
      end

      def check_enabled(service, level=3)
        "chkconfig --list #{escape(service)} | grep #{level}:on"
      end

      def check_yumrepo(repository)
        "yum repolist all -C | grep ^#{escape(repository)}"
      end

      def check_yumrepo_enabled(repository)
        "yum repolist all -C | grep ^#{escape(repository)} | grep enabled"
      end

      def check_installed(package,version=nil)
        cmd = "rpm -q #{escape(package)}"
        if ! version.nil?
          cmd = "#{cmd} | grep -w -- #{escape(version)}"
        end
        cmd
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
serverspec-0.6.22 lib/serverspec/commands/redhat.rb
serverspec-0.6.21 lib/serverspec/commands/redhat.rb
serverspec-0.6.20 lib/serverspec/commands/redhat.rb
serverspec-0.6.19 lib/serverspec/commands/redhat.rb
serverspec-0.6.18 lib/serverspec/commands/redhat.rb
serverspec-0.6.17 lib/serverspec/commands/redhat.rb
serverspec-0.6.16 lib/serverspec/commands/redhat.rb
serverspec-0.6.15 lib/serverspec/commands/redhat.rb
serverspec-0.6.13 lib/serverspec/commands/redhat.rb