Sha256: 518f4481e10eeb77e9b08bca58bdd7035e1d13d75a891cc4b1a085d07b7150f2

Contents?: true

Size: 843 Bytes

Versions: 37

Compression:

Stored size: 843 Bytes

Contents

module Serverspec
  module Commands
    class RedHat < Linux
      def check_access_by_user(file, user, access)
        # Redhat-specific
        "runuser -s /bin/sh -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
          cmd = "#{cmd} | grep -w -- #{escape(version)}"
        end
        cmd
      end

      alias :check_installed_by_rpm :check_installed
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
serverspec-0.12.0 lib/serverspec/commands/redhat.rb
serverspec-0.11.5 lib/serverspec/commands/redhat.rb
serverspec-0.11.4 lib/serverspec/commands/redhat.rb
serverspec-0.11.3 lib/serverspec/commands/redhat.rb
serverspec-0.11.2 lib/serverspec/commands/redhat.rb
serverspec-0.11.1 lib/serverspec/commands/redhat.rb
serverspec-0.11.0 lib/serverspec/commands/redhat.rb
serverspec-0.10.13 lib/serverspec/commands/redhat.rb
serverspec-0.10.12 lib/serverspec/commands/redhat.rb
serverspec-0.10.11 lib/serverspec/commands/redhat.rb
serverspec-0.10.10 lib/serverspec/commands/redhat.rb
serverspec-0.10.9 lib/serverspec/commands/redhat.rb
serverspec-0.10.8 lib/serverspec/commands/redhat.rb
serverspec-0.10.7 lib/serverspec/commands/redhat.rb
serverspec-0.10.6 lib/serverspec/commands/redhat.rb
serverspec-0.10.5 lib/serverspec/commands/redhat.rb
serverspec-0.10.4 lib/serverspec/commands/redhat.rb
serverspec-0.10.3 lib/serverspec/commands/redhat.rb
serverspec-0.10.2 lib/serverspec/commands/redhat.rb
serverspec-0.10.1 lib/serverspec/commands/redhat.rb