Class: SpatulaProvisioner
- Inherits:
-
Vagrant::Provisioners::Base
- Object
- Vagrant::Provisioners::Base
- SpatulaProvisioner
- Defined in:
- lib/vagrant/spatula.rb
Defined Under Namespace
Classes: Config
Constant Summary collapse
- VERSION =
"0.0.3"
Instance Method Summary collapse
Instance Method Details
#provision! ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/vagrant/spatula.rb', line 9 def provision! @spatula_path = ENV["PATH"]. split(File::PATH_SEPARATOR). map { |x| File.join(x, "spatula") }. select { |x| File.executable?(x) } @spatula_path = @spatula_path[0] rescue nil raise "Cannot find spatula: gem install spatula" unless @spatula_path extra_args = %W[--port #{vm.ssh.port} --identity #{config.top.ssh.private_key_path}] args = [@spatula_path] + %w[prepare vagrant@localhost] + extra_args system(*args) raise "Could not prepare the host" unless $?.exitstatus == 0 extra_args += %W[--log-level #{config.log_level || 'info'}] args = [@spatula_path] + %W[cook vagrant@localhost #{config.node}] + extra_args system(*args) raise "Could not cook the host" unless $?.exitstatus == 0 end |