Use Vagrant::Util::Subprocess.execute instead of SafeExec

This commit is contained in:
Collin Allen 2013-04-04 00:07:59 -07:00
parent 28f4a4c890
commit bbe08744a2
1 changed files with 7 additions and 1 deletions

View File

@ -19,9 +19,15 @@ module VagrantPlugins
options << "--sudo-user=#{config.sudo_user}" if config.sudo_user
options << "--verbose" if config.verbose
# Assemble the full ansible-playbook command
command = (%w(ansible-playbook) << options << config.playbook).flatten
Vagrant::Util::SafeExec.exec(*command)
# Write stdout and stderr data, since it's the regular Ansible output
command << { :notify => [:stdout, :stderr] }
Vagrant::Util::Subprocess.execute(*command) do |type, data|
puts "#{data}" if type == :stdout || type == :stderr
yield type, data if block_given?
end
end
end
end