class TestLab::Provisioner::Shell

Shell Provisioner Class

@author Zachary Patten <zachary AT jovelabs DOT com>

Public Class Methods

new(config={}, ui=nil) click to toggle source
# File lib/testlab/provisioners/shell.rb, line 14
def initialize(config={}, ui=nil)
  @ui     = (ui     || TestLab.ui)
  @config = (config || Hash.new)
end

Public Instance Methods

on_container_provision(container) click to toggle source

Shell: Container Provision

Renders the defined script to a temporary file on the target container and proceeds to execute said script as root via lxc-attach.

@param [TestLab::Container] container The container which we want to

provision.

@return [Boolean] True if successful.

# File lib/testlab/provisioners/shell.rb, line 27
def on_container_provision(container)
  @config[:script].nil? and raise ShellError, "You must supply a script to bootstrap!"

  container.bootstrap(@config[:script])

  true
end