Sha256: 69c15ff435a303a7dd4ed9eb788409dd6360c8a48b9e3b608f93c5348f4e46c9

Contents?: true

Size: 819 Bytes

Versions: 27

Compression:

Stored size: 819 Bytes

Contents

class TestLab
  class Node

    module Resolv
      require 'tempfile'

      # Builds the main resolv configuration sections
      def build_resolv_main_conf(file)
        resolv_conf_template = File.join(self.class.template_dir, "resolv.erb")

        context = {
          :servers => [TestLab::Network.ips, "8.8.8.8", "8.8.4.4" ].flatten,
          :search => TestLab::Container.domains.join(' ')
        }

        file.puts(ZTK::Template.do_not_edit_notice(:message => "TestLab v#{TestLab::VERSION} RESOLVER Configuration"))
        file.puts(ZTK::Template.render(resolv_conf_template, context))
      end

      def build_resolv_conf
        self.ssh.file(:target => File.join("/etc/resolv.conf"), :chown => "root:root") do |file|
          build_resolv_main_conf(file)
        end
      end

    end

  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
testlab-0.5.4 lib/testlab/node/resolv.rb
testlab-0.5.3 lib/testlab/node/resolv.rb
testlab-0.5.2 lib/testlab/node/resolv.rb
testlab-0.5.1 lib/testlab/node/resolv.rb
testlab-0.5.0 lib/testlab/node/resolv.rb
testlab-0.4.16 lib/testlab/node/resolv.rb
testlab-0.4.15 lib/testlab/node/resolv.rb
testlab-0.4.14 lib/testlab/node/resolv.rb
testlab-0.4.13 lib/testlab/node/resolv.rb
testlab-0.4.12 lib/testlab/node/resolv.rb
testlab-0.4.11 lib/testlab/node/resolv.rb
testlab-0.4.10 lib/testlab/node/resolv.rb
testlab-0.4.9 lib/testlab/node/resolv.rb
testlab-0.4.8 lib/testlab/node/resolv.rb
testlab-0.4.7 lib/testlab/node/resolv.rb
testlab-0.4.6 lib/testlab/node/resolv.rb
testlab-0.4.5 lib/testlab/node/resolv.rb
testlab-0.4.4 lib/testlab/node/resolv.rb
testlab-0.4.3 lib/testlab/node/resolv.rb
testlab-0.4.2 lib/testlab/node/resolv.rb