Sha256: e334f6a4d1c4a78e232e180d3c8ef7990f8ac1092bbaf5356f2a7ed4f453be55

Contents?: true

Size: 454 Bytes

Versions: 15

Compression:

Stored size: 454 Bytes

Contents

module Landrush
  module Cap
    module Linux
      module ConfiguredDnsServer
        def self.configured_dns_server(machine)
          return @dns_server if @dns_server
          machine.communicate.sudo('cat /etc/resolv.conf | grep ^nameserver') do |type, data|
            if type == :stdout
              @dns_server = data.scan(/\d+\.\d+\.\d+\.\d+/).first
            end
          end
          @dns_server
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
landrush-0.14.1 lib/landrush/cap/linux/configured_dns_server.rb
landrush-0.14.0 lib/landrush/cap/linux/configured_dns_server.rb
landrush-0.13.1 lib/landrush/cap/linux/configured_dns_server.rb
landrush-0.13.0 lib/landrush/cap/linux/configured_dns_server.rb
landrush-0.12.0 lib/landrush/cap/linux/configured_dns_server.rb
landrush-0.11.0 lib/landrush/cap/linux/configured_dns_server.rb
landrush-0.10.0 lib/landrush/cap/linux/configured_dns_server.rb
landrush-0.9.0 lib/landrush/cap/linux/configured_dns_server.rb
landrush-0.8.0 lib/landrush/cap/linux/configured_dns_server.rb
landrush-0.7.1 lib/landrush/cap/linux/configured_dns_server.rb
landrush-0.7.0 lib/landrush/cap/linux/configured_dns_server.rb
landrush-0.6.0 lib/landrush/cap/linux/configured_dns_server.rb
landrush-0.5.0 lib/landrush/cap/linux/configured_dns_server.rb
landrush-0.4.1 lib/landrush/cap/linux/configured_dns_server.rb
landrush-0.4.0 lib/landrush/cap/linux/configured_dns_server.rb