Module: VagrantPlugins::Conductor::Module
- Included in:
- AmazonWebServices, BaseProvisioner
- Defined in:
- lib/vagrant/conductor/modules/module.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#config ⇒ Object
Returns the value of attribute config.
-
#scripts ⇒ Object
Returns the value of attribute scripts.
-
#templates ⇒ Object
Returns the value of attribute templates.
Instance Method Summary collapse
-
#generate_template(vars, template_file) ⇒ Object
Create the template.
- #initialize(config, args, path, sync_path) ⇒ Object
- #shell_provision(inline, args = nil, privileged = true) ⇒ Object
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
5 6 7 |
# File 'lib/vagrant/conductor/modules/module.rb', line 5 def args @args end |
#config ⇒ Object
Returns the value of attribute config.
5 6 7 |
# File 'lib/vagrant/conductor/modules/module.rb', line 5 def config @config end |
#scripts ⇒ Object
Returns the value of attribute scripts.
5 6 7 |
# File 'lib/vagrant/conductor/modules/module.rb', line 5 def scripts @scripts end |
#templates ⇒ Object
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 |