Sha256: 347bfa7a039ba8922b53b1f9627bf36d6ecaac14d0d8052a019b318d7e6dde16

Contents?: true

Size: 1.1 KB

Versions: 33

Compression:

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

        @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

33 entries across 33 versions & 1 rubygems

Version Path
testlab-1.9.2 lib/testlab/provisioners/apt.rb
testlab-1.9.1 lib/testlab/provisioners/apt.rb
testlab-1.9.0 lib/testlab/provisioners/apt.rb
testlab-1.8.5 lib/testlab/provisioners/apt.rb
testlab-1.8.4 lib/testlab/provisioners/apt.rb
testlab-1.8.3 lib/testlab/provisioners/apt.rb
testlab-1.8.2 lib/testlab/provisioners/apt.rb
testlab-1.8.1 lib/testlab/provisioners/apt.rb
testlab-1.8.0 lib/testlab/provisioners/apt.rb
testlab-1.7.1 lib/testlab/provisioners/apt.rb
testlab-1.7.0 lib/testlab/provisioners/apt.rb
testlab-1.6.6 lib/testlab/provisioners/apt.rb
testlab-1.6.5 lib/testlab/provisioners/apt.rb
testlab-1.6.4 lib/testlab/provisioners/apt.rb
testlab-1.6.3 lib/testlab/provisioners/apt.rb
testlab-1.6.2 lib/testlab/provisioners/apt.rb
testlab-1.6.1 lib/testlab/provisioners/apt.rb
testlab-1.6.0 lib/testlab/provisioners/apt.rb
testlab-1.5.1 lib/testlab/provisioners/apt.rb
testlab-1.5.0 lib/testlab/provisioners/apt.rb