Module: VagrantPlugins::Conductor::Module

Included in:
AmazonWebServices, BaseProvisioner
Defined in:
lib/vagrant/conductor/modules/module.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argsObject

Returns the value of attribute args.



5
6
7
# File 'lib/vagrant/conductor/modules/module.rb', line 5

def args
  @args
end

#configObject

Returns the value of attribute config.



5
6
7
# File 'lib/vagrant/conductor/modules/module.rb', line 5

def config
  @config
end

#scriptsObject

Returns the value of attribute scripts.



5
6
7
# File 'lib/vagrant/conductor/modules/module.rb', line 5

def scripts
  @scripts
end

#templatesObject

Returns the value of attribute templates.



5
6
7
# File 'lib/vagrant/conductor/modules/module.rb', line 5

def templates
  @templates
end

Instance Method Details

#generate_template(vars, template_file) ⇒ Object

Create the template



15
16
17
18
19
# File 'lib/vagrant/conductor/modules/module.rb', line 15

def generate_template(vars, template_file)
  require 'erb'
  template = File.read(@templates + "/#{template_file}.erb")
  ERB.new(template).result(binding)
end

#initialize(config, args, path, sync_path) ⇒ Object



7
8
9
10
11
12
# File 'lib/vagrant/conductor/modules/module.rb', line 7

def initialize(config, args, path, sync_path)
  @config = config
  @args = args
  @scripts = sync_path + "/scripts"
  @templates = path + "/templates"
end

#shell_provision(inline, args = nil, privileged = true) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/vagrant/conductor/modules/module.rb', line 21

def shell_provision(inline, args = nil, privileged = true)
  @config.vm.provision "shell" do |s|
    s.inline = inline
    s.args = args
    s.privileged = privileged
  end
end