Class: Vagrant::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Vagrant::RakeTask
- Includes:
- DaptivChefCI::RakeTaskHelpers, Rake::DSL
- Defined in:
- lib/daptiv-chef-ci/vagrant_task.rb
Overview
Example usage, creates a vmware base box:
Vagrant::RakeTask.new ‘vagrant_fusion’ do |t|
t.provider = :vmware_fusion
t.up_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
-
#destroy_retry_attempts ⇒ Object
Returns the value of attribute destroy_retry_attempts.
-
#destroy_timeout_in_seconds ⇒ Object
Returns the value of attribute destroy_timeout_in_seconds.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#halt_retry_attempts ⇒ Object
Returns the value of attribute halt_retry_attempts.
-
#halt_timeout_in_seconds ⇒ Object
Returns the value of attribute halt_timeout_in_seconds.
-
#provider ⇒ Object
Returns the value of attribute provider.
-
#up_timeout_in_seconds ⇒ Object
Returns the value of attribute up_timeout_in_seconds.
-
#vagrant_driver ⇒ Object
writeonly
Sets the attribute vagrant_driver.
-
#vagrantfile_dir ⇒ Object
Returns the value of attribute vagrantfile_dir.
Instance Method Summary collapse
-
#initialize(name = 'vagrant', desc = 'Vagrant up, halt, destroy task') {|_self| ... } ⇒ RakeTask
constructor
virtualbox provider.
Methods included from DaptivChefCI::RakeTaskHelpers
#execute, #exit_on_failure, #exit_on_failure=
Constructor Details
#initialize(name = 'vagrant', desc = 'Vagrant up, halt, destroy task') {|_self| ... } ⇒ RakeTask
virtualbox provider
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/daptiv-chef-ci/vagrant_task.rb', line 37 def initialize(name = 'vagrant', desc = 'Vagrant up, halt, destroy task') @name, @desc = name, desc @provider = :virtualbox @vagrantfile_dir = Dir.pwd @up_timeout_in_seconds = 7200 @halt_timeout_in_seconds = 180 @destroy_timeout_in_seconds = 180 @destroy_retry_attempts = 2 @halt_retry_attempts = 2 @environment = {} yield self if block_given? define_task end |
Instance Attribute Details
#destroy_retry_attempts ⇒ Object
Returns the value of attribute destroy_retry_attempts.
29 30 31 |
# File 'lib/daptiv-chef-ci/vagrant_task.rb', line 29 def destroy_retry_attempts @destroy_retry_attempts end |
#destroy_timeout_in_seconds ⇒ Object
Returns the value of attribute destroy_timeout_in_seconds.
28 29 30 |
# File 'lib/daptiv-chef-ci/vagrant_task.rb', line 28 def destroy_timeout_in_seconds @destroy_timeout_in_seconds end |
#environment ⇒ Object
Returns the value of attribute environment.
31 32 33 |
# File 'lib/daptiv-chef-ci/vagrant_task.rb', line 31 def environment @environment end |
#halt_retry_attempts ⇒ Object
Returns the value of attribute halt_retry_attempts.
30 31 32 |
# File 'lib/daptiv-chef-ci/vagrant_task.rb', line 30 def halt_retry_attempts @halt_retry_attempts end |
#halt_timeout_in_seconds ⇒ Object
Returns the value of attribute halt_timeout_in_seconds.
27 28 29 |
# File 'lib/daptiv-chef-ci/vagrant_task.rb', line 27 def halt_timeout_in_seconds @halt_timeout_in_seconds end |
#provider ⇒ Object
Returns the value of attribute provider.
24 25 26 |
# File 'lib/daptiv-chef-ci/vagrant_task.rb', line 24 def provider @provider end |
#up_timeout_in_seconds ⇒ Object
Returns the value of attribute up_timeout_in_seconds.
26 27 28 |
# File 'lib/daptiv-chef-ci/vagrant_task.rb', line 26 def up_timeout_in_seconds @up_timeout_in_seconds end |
#vagrant_driver=(value) ⇒ Object
Sets the attribute vagrant_driver
23 24 25 |
# File 'lib/daptiv-chef-ci/vagrant_task.rb', line 23 def vagrant_driver=(value) @vagrant_driver = value end |
#vagrantfile_dir ⇒ Object
Returns the value of attribute vagrantfile_dir.
25 26 27 |
# File 'lib/daptiv-chef-ci/vagrant_task.rb', line 25 def vagrantfile_dir @vagrantfile_dir end |