From bbe08744a25bfe2caa50bab529f7991a43e98c84 Mon Sep 17 00:00:00 2001 From: Collin Allen Date: Thu, 4 Apr 2013 00:07:59 -0700 Subject: [PATCH] Use Vagrant::Util::Subprocess.execute instead of SafeExec --- plugins/provisioners/ansible/provisioner.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/provisioners/ansible/provisioner.rb b/plugins/provisioners/ansible/provisioner.rb index 4a670cd6e..b47341090 100644 --- a/plugins/provisioners/ansible/provisioner.rb +++ b/plugins/provisioners/ansible/provisioner.rb @@ -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