Class: VagrantProvision::RakeTask

Inherits:
Rake::TaskLib
  • Object
show all
Includes:
DaptivChefCI::RakeTaskHelpers, Rake::DSL
Defined in:
lib/daptiv-chef-ci/vagrant_provision_task.rb

Overview

Example usage, provisions a vmware box (box must already be up):

VagrantProvision::RakeTask.new ‘provision’ do |t|

t.provision_timeout_in_seconds = 3600
t.environment = { :ENV_VAR1 => 'val1', :ENV_VAR2 => 'val2' }

end

This class lets you define Rake tasks to drive Vagrant.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DaptivChefCI::RakeTaskHelpers

#execute, #exit_on_failure, #exit_on_failure=

Constructor Details

#initialize(name = 'vagrant_provision', desc = 'Vagrant provision task') {|_self| ... } ⇒ RakeTask

Returns a new instance of RakeTask.

Parameters:

  • name (String) (defaults to: 'vagrant_provision')

    The task name.

  • desc (String) (defaults to: 'Vagrant provision task')

    Description of the task.

  • provider (String)

    vagrant provider to use if other than the default virtualbox provider

Yields:

  • (_self)

Yield Parameters:



29
30
31
32
33
34
35
# File 'lib/daptiv-chef-ci/vagrant_provision_task.rb', line 29

def initialize(name = 'vagrant_provision', desc = 'Vagrant provision task')
  @name, @desc = name, desc
  @provision_timeout_in_seconds = 7200
  @environment = {}
  yield self if block_given?
  define_task
end

Instance Attribute Details

#environmentObject

Returns the value of attribute environment.



24
25
26
# File 'lib/daptiv-chef-ci/vagrant_provision_task.rb', line 24

def environment
  @environment
end

#provision_timeout_in_secondsObject

Returns the value of attribute provision_timeout_in_seconds.



23
24
25
# File 'lib/daptiv-chef-ci/vagrant_provision_task.rb', line 23

def provision_timeout_in_seconds
  @provision_timeout_in_seconds
end

#vagrant_driver=(value) ⇒ Object

Sets the attribute vagrant_driver

Parameters:

  • value

    the value to set the attribute vagrant_driver to.



22
23
24
# File 'lib/daptiv-chef-ci/vagrant_provision_task.rb', line 22

def vagrant_driver=(value)
  @vagrant_driver = value
end