Sha256: d695bdc1518b5e7ab21616132a538a6549e1f1fc81179b2d2e7aade22920918c

Contents?: true

Size: 1.2 KB

Versions: 34

Compression:

Stored size: 1.2 KB

Contents

class TestLab

  class Provisioner

    # APT Provisioner Error Class
    class AptError < ProvisionerError; end

    # APT Provisioner Class
    #
    # @author Zachary Patten <zachary AT jovelabs DOT com>
    class Apt

      def initialize(config={}, ui=nil)
        @config = (config || Hash.new)
        @ui     = (ui     || TestLab.ui)

        @config[:apt] ||= Hash.new
        @config[:apt][:install]   ||= Array.new
        @config[:apt][:remove]    ||= Array.new
        @config[:apt][:purge]     ||= Array.new
        @config[:apt][:sources]   ||= Array.new
        @config[:apt][:multiarch] ||= true

        @ui.logger.debug { "config(#{@config.inspect})" }
      end

      # APT: Container Provision
      #
      # @param [TestLab::Container] container The container which we want to
      #   provision.
      # @return [Boolean] True if successful.
      def on_container_provision(container)
        @ui.logger.debug { "APT Provisioner: Container #{container.id}" }

        container.bootstrap(ZTK::Template.render(provision_template, @config))
      end

    private

      def provision_template
        File.join(TestLab::Provisioner.template_dir, 'apt', 'provision.erb')
      end

    end

  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
testlab-1.22.4 lib/testlab/provisioners/apt.rb
testlab-1.22.3 lib/testlab/provisioners/apt.rb
testlab-1.22.2 lib/testlab/provisioners/apt.rb
testlab-1.22.1 lib/testlab/provisioners/apt.rb
testlab-1.22.0 lib/testlab/provisioners/apt.rb
testlab-1.21.1 lib/testlab/provisioners/apt.rb
testlab-1.21.0 lib/testlab/provisioners/apt.rb
testlab-1.20.6 lib/testlab/provisioners/apt.rb
testlab-1.20.5 lib/testlab/provisioners/apt.rb
testlab-1.20.4 lib/testlab/provisioners/apt.rb
testlab-1.20.3 lib/testlab/provisioners/apt.rb
testlab-1.20.2 lib/testlab/provisioners/apt.rb
testlab-1.20.1 lib/testlab/provisioners/apt.rb
testlab-1.20.0 lib/testlab/provisioners/apt.rb
testlab-1.19.0 lib/testlab/provisioners/apt.rb
testlab-1.18.1 lib/testlab/provisioners/apt.rb
testlab-1.18.0 lib/testlab/provisioners/apt.rb
testlab-1.17.0 lib/testlab/provisioners/apt.rb
testlab-1.16.1 lib/testlab/provisioners/apt.rb
testlab-1.16.0 lib/testlab/provisioners/apt.rb