Sha256: 43bf35904c7fb4095220e0ddf564c51bb0c45b9bfc53e5e6f4ff58dbff3cc3e1

Contents?: true

Size: 555 Bytes

Versions: 30

Compression:

Stored size: 555 Bytes

Contents

module Serverspec
  module Type
    class DefaultGateway < Base
      def ipaddress
        ret = backend.run_command(commands.check_routing_table('default'))
        ret.stdout =~ /^(\S+)(?: via (\S+))? dev (\S+).+(?:\r)?\n(?:default via (\S+))?/
        $2 ? $2 : $4
      end

      def interface
        ret = backend.run_command(commands.check_routing_table('default'))
        ret.stdout =~ /^(\S+)(?: via (\S+))? dev (\S+).+(?:\r)?\n(?:default via (\S+))?/
        $3
      end

      def to_s
        'Default Gateway'
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
serverspec-1.16.0 lib/serverspec/type/default_gateway.rb
serverspec-1.15.0 lib/serverspec/type/default_gateway.rb
serverspec-1.14.0 lib/serverspec/type/default_gateway.rb
serverspec-1.13.0 lib/serverspec/type/default_gateway.rb
serverspec-1.12.0 lib/serverspec/type/default_gateway.rb
serverspec-1.11.0 lib/serverspec/type/default_gateway.rb
serverspec-1.10.0 lib/serverspec/type/default_gateway.rb
serverspec-1.9.1 lib/serverspec/type/default_gateway.rb
serverspec-1.9.0 lib/serverspec/type/default_gateway.rb
serverspec-1.8.0 lib/serverspec/type/default_gateway.rb
serverspec-1.7.1 lib/serverspec/type/default_gateway.rb
serverspec-1.7.0 lib/serverspec/type/default_gateway.rb
serverspec-1.6.0 lib/serverspec/type/default_gateway.rb
serverspec-1.5.0 lib/serverspec/type/default_gateway.rb
serverspec-2.0.0.beta2 lib/serverspec/type/default_gateway.rb
serverspec-1.4.2 lib/serverspec/type/default_gateway.rb
serverspec-2.0.0.beta1 lib/serverspec/type/default_gateway.rb
serverspec-1.4.1 lib/serverspec/type/default_gateway.rb
serverspec-1.4.0 lib/serverspec/type/default_gateway.rb
serverspec-1.3.0 lib/serverspec/type/default_gateway.rb