Sha256: 228270f9f189d3314c69f2b5e8a15bedd7da597d7888a2e02e09756393186d82

Contents?: true

Size: 839 Bytes

Versions: 14

Compression:

Stored size: 839 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

      alias :check_installed_by_rpm :check_installed
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
serverspec-0.7.5 lib/serverspec/commands/redhat.rb
serverspec-0.7.4 lib/serverspec/commands/redhat.rb
serverspec-0.7.3 lib/serverspec/commands/redhat.rb
serverspec-0.7.2 lib/serverspec/commands/redhat.rb
serverspec-0.7.1 lib/serverspec/commands/redhat.rb
serverspec-0.7.0 lib/serverspec/commands/redhat.rb
serverspec-0.6.30 lib/serverspec/commands/redhat.rb
serverspec-0.6.29 lib/serverspec/commands/redhat.rb
serverspec-0.6.28 lib/serverspec/commands/redhat.rb
serverspec-0.6.27 lib/serverspec/commands/redhat.rb
serverspec-0.6.26 lib/serverspec/commands/redhat.rb
serverspec-0.6.25 lib/serverspec/commands/redhat.rb
serverspec-0.6.24 lib/serverspec/commands/redhat.rb
serverspec-0.6.23 lib/serverspec/commands/redhat.rb